Change database connection for all layers

8658
7
Jump to solution
06-17-2015 02:23 AM
DavidVent
New Contributor

Hello,

how is it in ArcGis Pro possible to change the database connection datasource for all Layers.

2015-06-17 11_20_46-ArcGIS Pro - MyProject4 - Map.png

Thank your for you help.

Experience: With ArcCatalog it was possible to change mxd files datasouce of layers.

0 Kudos
1 Solution

Accepted Solutions
MichaelRobb
Occasional Contributor III

ArcGIS Server question?

You can only do the Change data Source for multiple IF the links are broken.  Depending on the situation, one would/could update broken links layer by layer. Update all broken links in Dataframe at once. But what if there are No broken links but want to change the source?

David does not state 'broken layers' anywhere...but rather 'how to change the database conneciton datasource in all layers'

I use py to re-source all layers with the following example: 

*caveat: the new datasource must include all the FeatureClasses etc used in the original

Import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")

mxd.findAndReplaceWorkspacePaths(r"Database Connections\xxxxx.sde",r"Database Connections\xxxx.sde")

View solution in original post

7 Replies
QuinnFrancis
New Contributor III

Hi David,

You can change the data source of layers by right clicking on the layer in the Contents pane > Properties > Source tab > Change data source.

Repair broken data links—ArcGIS Pro | ArcGIS for Professionals

MichaelRobb
Occasional Contributor III

ArcGIS Server question?

You can only do the Change data Source for multiple IF the links are broken.  Depending on the situation, one would/could update broken links layer by layer. Update all broken links in Dataframe at once. But what if there are No broken links but want to change the source?

David does not state 'broken layers' anywhere...but rather 'how to change the database conneciton datasource in all layers'

I use py to re-source all layers with the following example: 

*caveat: the new datasource must include all the FeatureClasses etc used in the original

Import arcpy

mxd = arcpy.mapping.MapDocument("CURRENT")

mxd.findAndReplaceWorkspacePaths(r"Database Connections\xxxxx.sde",r"Database Connections\xxxx.sde")

MarcelSt-Germain
Occasional Contributor III

Yes, one layer by one layer.  For now it's in planing phase for change datasource.

Esri doesn't understand this need so no rush on this.

In the waiting time, i'm doing this by creating a broken link (putting a x before the name of the database) after the project is closed.  Then, I repair multiple link with these instructions.

Réparer des liaisons de données endommagées—ArcGIS Pro | Documentation 

Hope this will be of some help.

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

Not sure if this will work in you situation, but I sometimes export the map to a mapx, open in notepad++ and use find and replace. Mapx is a json file

MarcelSt-Germain
Occasional Contributor III

Thanks,

But, just changing the source in pro by creating a broken link is simpler for me.  Maybe one day they will include link management.

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

2.6 has some good stuff coming.

0 Kudos
MarcelSt-Germain
Occasional Contributor III

Yes, can't wait to see.  Date of release for 2.6 ?

0 Kudos