Synchronize Mobile Cache (Mobile)
Synchronizes a mobile cache with its data source.
This tool can post updates in a mobile cache to its data source using its originating map document. This tool can also be used to pull changes in the geodatabase to mobile cache.
The tool is only available for use with Microsoft Windows operating systems.
This tool synchronizes a mobile cache with its data source via a map document; this map document is the one that the mobile cache is extracted from. When uploading changes from a mobile cache to the map document, this tool checks if the map document has the same schema as the mobile cache by comparing their checksums. The checksum is calculated based on the schema of the selected map layers' data source. If the schema has changed, you will not be able to synchronize changes.
By default, the extent to upload or download changes is based on the map document's full extent; this can be overridden by using the Extent parameter. This tool accepts extents specified in the Environment Settings.
Only vector layers based on geodatabase data sources (file-based and enterprise) can be synchronized between the mobile cache and its data source. By default, all layers will be examined, and all edits will be checked in.
When you choose to download changes only, this tool gets changes from its data source, keeping the local edits in the cache. If the data source is a versioned geodatabase, this tool downloads data to the mobile cache from the specified version; if no download version is specified, it downloads from the default version.
When you choose to upload changes only, the changes in the mobile cache are uploaded to its data source. If the data source is a versioned geodatabase, it always uploads the changes to the same version that the mobile cache is extracted from.
When both Upload Changes and Download Changes are selected, this tool first uploads edits from the mobile cache to its data source, removes the mobile cache, then re-creates the mobile cache for the specified version (if the geodatabase is versioned).
The Map Document to synchronize with the mobile cache.
The directory where the mobile cache is located.
Choose to upload changes from a mobile cache to the map document:
Choose to download data from the map document to a mobile cache:
The extent can be specified as a string or list using four coordinates (min_x min_y max_x max_y) or by creating an extent object and setting its properties.
The names of the layers to synchronize.
The version of geodatabase for download data.
Synchronize all layers in a mobile cache file with its map document.
import arcpy arcpy.SynchronizeMobileCache_mobile(“c:/map/redlands.mxd”, “c:/cache“, "true","true","","","")
Upload changes from a mobile cache to its map document for all layers, extent.specified.
import arcpy arcpy.SynchronizeMobileCache_mobile(“c:/map/redlands.mxd”, “c:/cache“, "","true", "", "-1834676.42491188 -398227.791203287 -1833518.27644341 -396875.282178691","","")
Synchronize selected layers in a mobile cache file to its map document, extent specified.
import arcpy map_document = "C:/map/redlands.mxd" cache_folder = "C:/Mobile/DeploymentPackages/Redlands" extent = "-117.274738 34.001452 -117.1115 34.135168" layers = "qa.SDE.Vents;qa.SDE.Offices" arcpy.SynchronizeMobileCache_mobile(map_document,cache_folder,"true","true",extract_extent,layers,"#")