Repairing broken data links
When you open a map, ArcMap looks for the data referenced by each of the layers in the map. If ArcMap can't find the data source for a particular layer, that layer won't be drawn. You can immediately tell whether a layer on your map has a broken data link because it will have a red exclamation point next to its name in the table of contents, and the check box next to the layer will be unavailable.
A layer needs repairing if the data source it references has been moved, renamed, or deleted or is inaccessible for some other reason.
There are a number of ways to repair broken data links, which are described in the following sections:
Repairing a broken link for one layer
If you only want to repair a broken link for a specific layer, click the Set Data Source button on the Source tab of the Layer Properties dialog box.
This lets you specify the layer's data source by browsing to it. Select the desired data source on the Data Source dialog box, and click Add to repair the layer.
When you use this button to repair a layer, the application will only repair the current layer, even if the data sources of other layers that need repairing can be found in the location of the data source you specify.
Repairing broken links for multiple layers
You may find that several layers in your map need repairing. For example, if a geodatabase containing data sources that are used for multiple layers in your map has been moved or renamed, all these layers will need to be repaired. If you want to repair several layers at once, right-click the layer with the broken link and click Data > Repair Data Source. You can also click the red exclamation mark to open the Set Data Source dialog box as shown here.
When the repair to the data link is made from the table of contents, ArcMap repairs the selected layer using the data source you browse to and automatically repairs other broken layers if it can find their data sources in the same location of the data source you specified.
Using the arcpy.mapping module to find and repair data links for a number of map documents
Geoprocessing contains the arcpy.mapping module that will help you to manage your library of ArcMap documents. This set of Python functions helps you automate a number of map management and output (printing and exporting) workflows.
For example, you can
- Create a list of maps that have layers referencing a certain data source.
- Update or repair the data source links of all layers in a map document.
- Update the data references for all the maps in a folder that reference the same geodatabase.
See Geoprocessing scripts for map document management and output and Updating and Fixing Data Sources with arcpy.mapping for more information.
Changing the data source when the link isn't broken
If you want to change the data source used by a layer, use the Set Data Source button on the Source tab of the Layer Properties dialog box. To change the data source used by multiple layers in an ArcMap document at once, irrespective of whether or not the layers need repairing, use the Set Data Source command in ArcCatalog. You access this command by browsing to the folder in ArcCatalog where your map document is located and right-clicking the map document. This option is not available for ArcGlobe or ArcScene documents. Learn more about setting data sources
What happens if I can't repair a broken layer?
If you don't know the new location of the data source used by a layer that needs to be repaired, or if that data source is no longer available, you can leave the broken layer as is and continue to work with the map. The broken layer will continue to be shown in the table of contents with a red exclamation mark. If you no longer need the layer, you can remove it.