Introduction
It is not uncommon for your GIS data sources to move, migrate to a new data format or be deleted. The result can be broken data sources in many map document or layer files. These broken data sources can't be used until they have been fixed, which can be an overwhelming process if the same changes need to be made across numerous map documents. You can automate the process of finding and fixing these data sources using arcpy.mapping
, without ever having to open the affected map documents. Finding broken data sources is a simple process requiring the use of the ListBrokenDataSources()
function, which returns a Python list of all broken data sources in a map document or layer file. Typically, this function is used as the first step in a script that iterates through the list and fixes the data sources. Fixing broken data sources can be performed on the individual data layer or across all the layers in a common workspace.