Summary
Upgrades the compact cache storage format of a map or image service (created at 10.2.2 and earlier versions) to take advantage of performance improvements available at 10.3 and later versions.
Beginning at 10.3, the compact cache storage format was improved to increase performance when consuming cached map and image services. Improvements also reduced the number of files created in the cache directory by including the tile index information (.bundlx files) inside the .bundle files. New compact caches created with ArcGIS 10.3 for Server (and later versions) will automatically leverage the performance improvements.
If you upgrade to 10.3 and later versions, your services with compact caches generated in earlier versions will continue to work. You can continue to maintain these caches using the server cache tools.
If you want your existing cache to leverage the performance improvements, upgrade to 10.3 (or later versions) and then upgrade the cache using this tool. Upgrading the cache does not create new tiles; instead, the files are reorganized to be compliant with the improved format.
The improved compact cache storage format is not backwards compatible with earlier versions of ArcGIS. For example, a compact cache created or upgraded using 10.3 (or later versions) cannot be transferred and consumed in 10.2.2 (or earlier versions) of the software. The improved compact cache storage format is always expected to be associated with a service.
Usage
To use this tool, specify the map or image service cache you want to upgrade. The tool detects the current storage format of the service and uses that information to determine if the cache can be upgraded.
You can choose how many service instances to dedicate to upgrading the cache by specifying a value in the Number of caching service instances (num_of_caching_service_instances in Python) parameter.
This tool does not create new tiles; instead, the existing tiles are reorganized in the same folder to be compliant with the improved format. The old format is deleted as part of the upgrade. It's recommended you back up your existing cache before running this tool.
If the tool fails or is canceled during operation, rerunning the tool will start the task again from where it failed or was canceled.
To upgrade a cache service with exploded format, use the Convert Map Server Cache Storage Format tool.
Syntax
UpgradeMapServerCacheStorageFormat(input_service, {num_of_caching_service_instances})
Parameter | Explanation | Data Type |
input_service | The map or image service cache you want to upgrade. This string contains both the server and service information. To see how to construct this string, open ArcCatalog, select your service in the Catalog tree, and note the text in the Location toolbar. Then change the backslashes to forward slashes, for example, GIS Servers/arcgis on MYSERVER (admin)/USA.MapServer. | String |
num_of_caching_service_instances (Optional) |
The total number of instances of the System/CachingTools service that you want to dedicate toward running this tool. You can increase the maximum number of instances per machine of the System/CachingTools service using the Service Editor window available through an administrative connection to ArcGIS Server. Ensure your server machines can support the chosen number of instances. | Long |
Code sample
Upgrade Map Cache Storage Format example (stand-alone script)
The following stand-alone script demonstrates how to upgrade the compact cache storage format.
# Name: UpgradeMapServerCacheStorageFormat.py
# Description: The following stand-alone script demonstrates how to upgrade map
# server cache storage format to the latest compact storage format
# Requirements: os, sys, time, traceback modules
# Any line that begins with a pound sign is a comment and will not be executed
# Empty quotes take the default value.
# To accept arguments from the command line replace values of variables to
# "sys.argv[]"
# Import system modules
import arcpy
from arcpy import env
import os, sys, time, string, datetime, traceback
# Set environment settings
env.workspace = "C:/data"
# Set local variables for mapservice properties
connectionFile = r"C:\Users\<username>\AppData\Roaming\ESRI\Desktop10.3\ArcCatalog"
server = "arcgis on MyServer_6080 (publisher)"
serviceName = "Rainfall.MapServer"
inputService = connectionFile + "\\" + server + "\\" + serviceName
numOfCachingServiceInstances = "2"
currentTime = datetime.datetime.now()
arg1 = currentTime.strftime("%H-%M")
arg2 = currentTime.strftime("%Y-%m-%d %H:%M")
file = "C:/data/report_%s.txt" % arg1
# print results of the script to a report
report = open(file,'w')
# Execute UpgradeMapServerCacheFormat
try:
starttime = time.clock()
result = arcpy.UpgradeMapServerCacheStorageFormat_server(inputService,
numOfCachingServiceInstances)
finishtime = time.clock()
elapsedtime = finishtime - starttime
#print messages to a file
while result.status < 4:
time.sleep(0.2)
resultValue = result.getMessages()
report.write ("completed " + str(resultValue))
print "Upgraded Map Server Cache Storage format for " + serviceName + " in " +\
str(elapsedtime) + " sec \n on" + arg2
except Exception, e:
# If an error occurred, print line number and error message
tb = sys.exc_info()[2]
report.write("Failed at step 1 \n" "Line %i" % tb.tb_lineno)
report.write(e.message)
report.close()
print "Upgraded Map Server Cache Storage format "
Environments
This tool does not use any geoprocessing environments.
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes