English

FAQ: What are the best practices to avoid broken data links in a map document when it is moved?

Question

What are the best practices to avoid broken data links in a map document when it is moved?

Answer

Data links are stored as map layer properties in a map document and are a path to the source data. When a map document is opened, ArcMap locates the data using the stored paths. When the source data is no longer in the directory where the path is pointed, ArcMap indicates that the data link is broken and that layer must be repaired. A layer with a broken data link has a red exclamation point next to the layer name:

User-added image
To repair broken data links, see the following document: Repairing broken data links

However, repairing individual data links can be tedious if there are many layers to fix in the map document. With a little preparation beforehand, broken data links can be prevented. The following are some ways to move the source data while preventing broken data links:

  • Store relative paths to data in the map document
Relative paths specify the location of the data relative to the current location of the map document. Since relative paths do not contain drive names, the paths enable a layer and its associated data to be moved to any disk drive without having to repair the layer's data links in the map document.

For more information on relative paths and how to store them in a map document, see the following document: Referencing data in the map
  • Create a map package
A map package is a single file that contains a map document and the data referenced by the layers in the map document. By creating a map package and checking the Convert data to file geodatabase option, the data links in the map document are not broken because the data is extracted into a file geodatabase as part of the map package.   
Note:
If there are any data referencing an enterprise geodatabase, ensure that the Include Enterprise geodatabase data instead of referencing the data option is checked when creating the map package.
For more information, see the following document: Package Map
  • Use arcpy.mapping to fix data sources
Alternatively, repairing broken data links can be automated with a Python script using arcpy.mapping. For more information, see the following document: Updating and fixing data sources with arcpy.mapping

Related Information