What do you do if a File Geodatabase has moved to a new storage location?

205
4
Jump to solution
a month ago
Labels (2)
PeterWang
New Contributor II

I have a file geodatabase on drive letter D:, let's call it D:/blah1/blah2/blah3/name.gdb, and it's moving to a new place, S:/win/data/blah1/blah2/blah3/name.gdb

I have ArcGIS Pro and ArcMAP projects. How do I repoint to the new file geodatabase location without doing "Right-click on each layer > Properties > Source > Set Data Source... repetitively for all of the layers in all of the projects?

It would be nice to do one repointing operation per project instead of creeping through all of the layers individually.

Thank you.

0 Kudos
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor
4 Replies
JayantaPoddar
MVP Esteemed Contributor

If the database is not available in older path, all the layers and tables in your map/project will be broken. Then, you can do Repair broken data sources for layers and tables for one layer, and data source of other layers pointing to the same database will get corrected.

Another way of achieving this, is using ArcPy. Updating and fixing data sources 

 

For ArcMap, Repairing broken data links 

0 Kudos
PeterWang
New Contributor II

That's good. Does "To update the data sources of all layers and stand-alone tables in the current project simultaneously, follow these steps" also exist for ArcMAP, or jut ArcGIS Pro?

I will look at the ArcPy solution.

0 Kudos
JayantaPoddar
MVP Esteemed Contributor
PeterWang
New Contributor II

This is really good for my purposes, from the ArcPy page:

The following example is very similar to the one above but uses partial path strings to replace the data sources. Be sure when using a partial string that it doesn't occur multiple times in a path. You may not get the results you would expect.

import arcpy
aprx = arcpy.mp.ArcGISProject(r'C:\Projects\YosemiteNP\Yosemite.aprx')
aprx.updateConnectionProperties('Data','Vector_Data')
aprx.saveACopy(r"C:\Projects\YosemiteNP\YosemiteNew.aprx")

0 Kudos