Select to view content in your preferred language

ArcGIS Pro Set/Update Data source for all layers in a Map

26068
21
Jump to solution
09-17-2019 07:06 PM
TauhidulIslam1
New Contributor

I have to change the data source of all the layers of an ArcGIS Pro project map because of data migration from one sde to another sde. Is there any ArcGIS pro functionality to replace the data source of all the layers using one tool similar to ArcCatalog set data source functionality for .mxd?

21 Replies
PR369
by
New Contributor

As of 2025, ArcGIS Pro 3.4 now includes the "Right Click on broken layer > Data > Repair Data Source" in ArcMap for multiple layers:

  1. Open your ArcGIS Pro project. (update to 3.4 or newer)
  2. Click on any layers with red exclamation points (!) that are sourced in the same general area to open the Change Data Source dialog box.
  3. This action will update all layers referencing the same broken source.

While it's a relief to finally have this functionality, it's disappointing that Esri over 10 years to implement such a basic and essential feature in ArcGIS Pro. This capability has been a staple in ArcMap for over 15 years, and its absence in Pro has been a significant pain for many GIS professionals. The delay in adding this feature has forced users to resort to complex workarounds and Python scripting, wasting countless hours on what should have been a simple task.

https://pro.arcgis.com/en/pro-app/3.3/help/mapping/layer-properties/repair-broken-data-links.htm

 

0 Kudos
cjms
by
Emerging Contributor

New ESRI help doc for ArcGIS Pro: Updating and Fixing Data Sources

If updating the entire project, use the updateConnectionProperties on an ArcGISProject object.

If updating individual maps, then get your Map object and loop through the layers.

aprx = arcpy.mp.ArcGISProject(r'current')
my_map = aprx.listMaps('my map name')[0]
layers = individual_layers_map.listLayers()
for layer in layers:
    # add if / else statements here if different layers have different sources
    # e.g. if(layer.name == 'your layer name'): use SDE 1, else use SDE 2, etc.
    layer.updateConnectionProperties(
        current_connection_info = r'<path to current SDE>',
        new_connection_info = r'<path to new SDE>'
    )

 

0 Kudos