Select to view content in your preferred language

Automate process "Repair Data Source"

3705
2
Jump to solution
06-01-2015 02:33 PM
GustavoCordero
New Contributor III

I'm using ArcGIS 10.3

I need to automate the process of "Repair Data Source"

anyone knows what tool to use in modelbuider or python function to make a Repair Data Source

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
SepheFox
Frequent Contributor

Hi Gustavo, you can use the Find and Replace Workspace Paths method:

import arcpy
mxd
= arcpy.mapping.MapDocument(r"C:\Project\Project_SDE1.mxd")
mxd
.findAndReplaceWorkspacePaths(r"Database Connections\Connection to GISSDE1.sde",
  r
"Database Connections\Connection to GISSDE2.sde")
mxd
.saveACopy(r"C:\Project\Project_SDE2.mxd")
del mxd

View solution in original post

0 Kudos
2 Replies
SepheFox
Frequent Contributor

Hi Gustavo, you can use the Find and Replace Workspace Paths method:

import arcpy
mxd
= arcpy.mapping.MapDocument(r"C:\Project\Project_SDE1.mxd")
mxd
.findAndReplaceWorkspacePaths(r"Database Connections\Connection to GISSDE1.sde",
  r
"Database Connections\Connection to GISSDE2.sde")
mxd
.saveACopy(r"C:\Project\Project_SDE2.mxd")
del mxd

0 Kudos
GustavoCordero
New Contributor III

this tool can be used to replace me specific layers?

0 Kudos