Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I change the data source of all layers in a map document using ArcPy and Python?

share|improve this question
If you clarified your question to include the real-life problem that you are trying to solve, you might get some answers with code examples in them... – DavidF Dec 1 '10 at 18:14
did you manage to fix that ? – Smalis May 7 '15 at 17:33

The documentation entitled Updating and fixing data sources with arcpy.mapping has several examples:

There are numerous reasons why data sources need to be repaired or redirected to different locations. The idea of making these changes manually in every affected map document can be overwhelming. Methods are available with the arcpy.mapping scripting environment that make it possible to automate these changes without even having to open a map document. You have control of updating data sources for individual layers, or you can update all layers at once that have a common workspace.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.