[GIS] Data Source of layer changing after copy/paste in Table of Contents of ArcMap

arcgis-10.0arcgis-desktoparcmaplayers

I run into this situation all the time;

I often just copy layers and groups of layers in the TOC of one Map Document and paste then into the TOC of another Map Document.

For the most part this works fine but often enough the Data Source of layer changes when pasted. As a result the pasted layer has the red exclamation mark beside and no data is displayed until I manually set the Data Source.

I confirmed that the Data source of the layer I copy on one document changes when I paste the layer into another document.

This is something that has been happening since the early 8.x version and still an issue in version 10 SP3. It's also not computer specific as i run into this issue on several computer.

Any ideas?

Layer after being pasted:

enter image description here

Source "layer being copied" Data Source:
enter image description here

Destination "after pasted in another document" Data Source:
enter image description here

Best Answer

This appears to be related to the map document's (MXD) default database and relative paths. See the ESRI Help for details on relative paths. Relative paths are generally a good thing. I'm not sure if this would be a bug, but is certainly a gotcha.

The resolution is to uncheck the "Store relative paths..." option in the map document properties of the source MXD, File->Map Document Properties...->Pathnames. You should then be able to copy the layers to the destination MXD and maintain the absolute paths. Once you are complete you can switch the source MXD back to relative paths.

An alternative solution would be to set the default database for the two MXDs to the same gdb. This is also accessed from the same Map Document Properties window.

For myself, I prefer to to use UNC paths for network resources. UNC paths largely eliminate issues related to map drives, etc. that can crop up in multi-user, multi-computer situations. UNC paths are not fool proof, but they help.