Skip to main content

Copying caches

At some point, you may need to transfer map caches between folders or machines. The process depends on the format of your cache, the versions of ArcGIS Server to and from which you are copying the cache, and the size of the cache file or files.

If you are copying and transferring a cache between two sites that are both using the same storage format, you can do so seamlessly from your machine.

Copy a compact cache

If you are transferring a compact cache generated by a site running 10.3 or later—meaning it is in the compactv2 format—to a site running ArcGIS Enterprise, use the Export Map Server Cache tool in ArcGIS Pro to export a cache in older storage formats as a compact or exploded cache.

Copy a large cache

Various commands can be used to copy large amounts of cached data. Along with cp -r and tar -cf, you can use the following commands to copy cache data:

If you need to copy large caches, use the command line instead of the copy and paste functions. The Robocopy command can copy a directory and all subdirectories therein. Following is one example of how you might use Robocopy to copy a cache, USA, from a location on the network (mapped to drive Z) to a cache directory on your local machine:

  • When copying a tarball archive cache, use the following command:

robocopy Z:\cache\USA C:\arcgisserver\arcgiscache\USA /s

dd if=<source tar file> of=<destination tar file> bs =2046k

Note:

The value of the block size (bs) can be increased or decreased to accommodate the appropriate bandwidth.

  • To copy large cache directories to a remote machine while tracking their progress, use the following command:

rsync -avx -progress /arcgiscache/mapservice user@remotemachine:/destination/directory

For further help with command line syntax and parameters, see the Robocopy command documentation from Microsoft.

Various third-party applications that are designed to help copy large numbers of files are available. Copying with these applications may prove more stable than using the operating system tools. Some of these applications allow scheduling and queuing of jobs.

You can also copy caches from filesystem directories to object stores in the cloud when the arcgiscache folder structure is maintained in the objectstore bucket or container and the cache directory name is the same as the service name.

Caches and folder structure

You can copy a cache onto a machine with an existing map service and the cache will be detected when the service restarts. The top-level cache folder must have the same name as the map service. An exception is when the map service is organized in a folder on the GIS server, in which case the top-level directory syntax is <folder name>_<map service name>.