Setting data sources

The Set Data Source(s) tool is available when you right-click a map document (.mxd) in ArcCatalog or the Catalog window. The tool can be used to change the referenced data sources in a map document.

Because the changes are only applied to the layer's data source, other layer properties like joins and relates or query definitions are not updated. For map documents, other customizations (VBA code, UI controls, and custom toolbars), graphs, and table window appearance properties are removed from .mxd files when you update their data sources using the Set Data Source(s) tool. To preserve these, update the data sources in ArcMap instead.

Learn more about changing data sources in ArcMap

When you change the referenced data source for a layer in an .mxd file, you can change the workspace type. For example, change the data source path from a personal geodatabase to a file geodatabase. You will need to make sure that the dataset exists in the new data location; otherwise, the layer's data link might be broken.

The tool will not override the .mxd file. Instead, a copy of the original file is created by default. You can change the referenced data sources for all layers in the map document or map service definition or for a specific data frame. To change a layer's referenced data source, you can find and replace the connection path of the layer's data source or browse to the new dataset you want to set for the layer. Every change you apply to a layer's data source can be reset to the current data source. Select the layer you want to reset, right-click, then choose Reset. If you choose Reset All, all changes to data sources you made will be reset to the current data source.

Browse for data

At the end of the selected layer entry is the Browse For Data Browse For Data button button. This opens the Browse For Data dialog box. On the dialog box, navigate to the data you want to use as reference for the layer. The changes you make will only apply to the selected layer.

NoteNote:

When changing the data source referencing ArcSDE data for an .mxd file, you can use the Replace or Replace All buttons in the same way as for file-based data.

Find and replace data source path

For file-based data sources, you can change the connection path to the referenced data source of a layer. Select one or multiple layers and click the Replace button to open the Replace dialog box. Here, you can verify which part of the current connection path you want to replace with the new connection path. If you want to change the connection paths of all layers, click the Replace All button to open the Replace All dialog box. Similar to the Replace dialog box, you can specify the part of the connection path you want to replace with the new connection path. After clicking Replace All, all layers will have the new connection path set. To achieve the correct connection path for a layer, use find and replace to change a string or character in the connection path multiple times; each time, the new data source will be changed.

Using Set Data Source(s) with .mxd files and ArcSDE data

  1. Right-click the .mxd file in ArcCatalog or the Catalog window and choose Set Data Source(s).
  2. Select a layer that references an ArcSDE data source you want to replace.
  3. Click the Replace All button. In the Replace with text box, type the path to the ArcSDE connection .sde file to replace in the current data source.
  4. Click Replace All to replace the found string with the new string in the data source connection path.
  5. Click OK to save the new .mxd file.

Using Set Data Source(s) to change the connection path

  1. Right-click the .mxd file in ArcCatalog or the Catalog window and choose Set Data Source(s).
  2. Select the layers you want to set a new data source for.
  3. Click the Replace button.
  4. In the Find what text box, define the string or character to find in the current data source.
  5. In the Replace with text box, define the string or character to replace in the current data source.
  6. Click Replace to replace the found string with the new string in the data source connection path.
  7. Click OK to save the output file.
NoteNote:

You can change the data source connection path to a UNIX conform connection path, for example, by changing the string \\myserver\ to /net/myserver.

2/10/2012