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?
Kory KramerMichael Volz
I found a solution. One of the ESRI Tech Support article it has the solution. I have tested it and it replaced my data sources. Because of my projects has only one data source for each, it worked for me. Still we need to have the multiple data source replace capability for the situation. ESRI ArcGIS Pro development team should put this a bit of higher priority because it actually is a very important tool. below my code-
import arcpy as py aprx = py.mp.ArcGISProject(r'project_location') find_dict = {'connection_info': {'instance': 'sde:sqlserver:server_instance', 'server': 'server_name'}} replace_dict = {'connection_info': {'instance': 'sde:sqlserver:server_instance', 'server': 'server_name', 'authentication_mode': 'OSA'}} try: aprx.updateConnectionProperties(find_dict, replace_dict) py.AddMessage("Data Source Updated") except NameError: py.AddMessage(' does not replaced SQL data Source!!!') aprx.save()
Hopefully this will help others.
@dcaESRIwvges if you are able to, can you share the file type and a typical filepath for your data (current and new)? I suspect that might help us or the Community be able to help you.
Still not working...I have tried everything i can think of from using dicitonaries to normal paths with os...and nothing.
Ah yes the ol' Pro "that one click in ArcMap is now a python science project" thing. Which also means everyone will do it slightly differently. Thakn you cjms though that is helpful. I just hope this can be made more point and click in a future update.
I don't see a Workspace button? Someone mentioned using Catalog View above. Looked for quite a while. Definitely used to be simple in ArcCatalog. (Change Data Sources)
Here is what I envision... it should be as simple as changing versions. Basically the same. Right click on a bunch of layers, say they are listed as Readonly @ Databasename. Right click and change it to ThisIsAnEditingUserConnection username and change it for all 25 layers at once. Basically under Change Version in the right-click menu, should be a Change User. Hopefully this gets fixed in the UI at some point.
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>' )
As of 2025, ArcGIS Pro 3.4 now includes the "Right Click on broken layer > Data > Repair Data Source" in ArcMap for multiple layers:
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
Not that one, you need to click the View Menu at the top. Then in there choose Catalog View (not Catalog Pane). From there click the Data Sources icon in the ribbon. Then the Workspace icon near the top left in the ribbon.
Do you mean from the Contents View?
The link is dead, Kory.
Glad it helped George.
Yes, this does work. Not quite as simple as the method we use within AM, but gets the job done.
Thank you for the reply.
Open Catalog View from within your project.From the ribbon that opens at the top, click on Data Sources.On the new ribbon, click to highlight Workspace.Now you can enter a new path for each data source, rather than each layer (which is hopefully a far shorter list).Click on Apply in the ribbon.
Still have not found the equivalent to AM that will work in AGP 3.2.2. So annoying.
Now in 3.1.1 I can only find it in the menu, not via right click. But it saved my day, to know that I have to search on map level and not for the whole project.
I'm using 3.1 and following these steps and also still getting the dreaded red exclamation mark as well. It is mighty annoying to have to change the source data by going and selecting the feature dataset, then the feature class for some 50 items in a project. EXTREMELY tempted to go back to the source doc in arcmap and change it there and then re-import back into pro. At least in desktop catalog IT WORKS RELIABLY for the change in data source.
I echo, Has a solution been found?
I followed the process outlined here (Update data sources—ArcGIS Pro | Documentation) but when I open my layouts I see the dreaded red exclamation mark and still need to update some of the data sources manually:
Has a solution been found?
Not sure if this was available when the problem was originally encountered, but in Pro 2.9.3, you can right-click on the map in the catalog pane and choose "Update Data Sources". There is a find and replace function you can use to batch update links to all the layers in the map. Hope this helps!
Hi Sean Phayakapong,
My reading of the documentation Updating and fixing data sources—ArcGIS Pro | Documentation
tells me you should be able to update the version in the connection dictionary. But you would need to be sure the user accessing the Project (or the Server service account using the published .msd) has access to the version you are trying to use. It is possible that a new version is only accessible to the creator of the version.
Did you get this resolved?
Hi I tried to replicate this and I could not update my connection property with a different version. I followed the technical guide. Are you able to update versions?
This idea has been around for over 3 years now. Do you know if a solution to this issue is even on the ESRI Road Map for Pro as an equivalency item that the Pro development will be working on?
That isn't in Pro yet. See this issue which we have tagged as an ArcMap equivalency issue.
https://community.esri.com/ideas/12449
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.