I have a big folder (20GB) (with different folders with shapes, rasters and filegeodatabases)

This folder has a orthographic mistake that I would like to correct.

This gdb is involved in a big number of mxd projects so it is quite impossible to replace the path manually.

I have a way to move feature class one by one (and each of them take a lot of time) but this is too much work.

(I use arcgis 10.2)

Anyone has an idea to resolve my issue?

  • As said above it is possible to use a script method. One note of cautious though . Are you sure the data is not being used by any other Mxds That are outside the folder you run the script on . If you re point the data to a new guy and then delete the old one . This will cause broken links Jul 30, 2015 at 17:29

1 Answer 1


You could use python/arcpy for this.

  1. Use os.walk method to find all .mxd files within directories/sub directories.
  2. Next, iterate through mxd and generate a list of layers (using for lyr in arcpy.mapping.ListLayers(mxd)).
  3. Use dataSource property to list source paths of layers and .find method to find old database name in path string. Use if conditional logic to evaluate if .find method variable is >-1, if so then use replaceDataSource method in step four.
  4. Use replaceDataSource method to resource layer to new layer name in gdb.
  5. Finally, use mxd.save() method to re-save map

This Q/A will give guidance for steps 2-4.

Repairing data sources in multiple MXDs using ArcPy?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.