Problems with ArcPy replaceWorkspaces and findAndReplaceWorkspacePaths validation

2591
2
08-12-2010 03:13 PM
RandyKreuziger
Occasional Contributor III
Our ArcSDE/SQL servers are 6 years old so we are migrating to new hardware.  The server name and IP address are changing so all MXDs are going to break.  We are also taking the "opportunity" to implement windows authentication for SDE connecitons.

I've been testing out ArcPy scripts using both the replaceWorkspaces and findAndReplaceWorkspacePaths commands but have run into problems with each.  The findAndReplaceWorkspacePaths command seems to ingore the validation setting when set to false.  It works in the replaceWorkspaces command but python crashs at the mxd.saveACopy command whenever the MXD contains a image services.

Anyone else experiencing these problems?

# This works where there are image services in the MXD
for myDataSource in uniqueDataSourceList:
    mxd.replaceWorkspaces(myDataSource, "SDE_WORKSPACE", outputGDB, "SDE_WORKSPACE")
mxd.saveACopy(outputMXD, '9.3')

# This crashes if there are images services in the MXD
for myDataSource in uniqueDataSourceList:
    mxd.replaceWorkspaces(myDataSource, "SDE_WORKSPACE", outputGDB, "SDE_WORKSPACE", False)
mxd.saveACopy(outputMXD, '9.3')
0 Kudos
2 Replies
JayCummins
New Contributor III
Yes.  NIM060315

Our ArcSDE/SQL servers are 6 years old so we are migrating to new hardware.  The server name and IP address are changing so all MXDs are going to break.  We are also taking the "opportunity" to implement windows authentication for SDE connecitons.

I've been testing out ArcPy scripts using both the replaceWorkspaces and findAndReplaceWorkspacePaths commands but have run into problems with each.  The findAndReplaceWorkspacePaths command seems to ingore the validation setting when set to false.  It works in the replaceWorkspaces command but python crashs at the mxd.saveACopy command whenever the MXD contains a image services.

Anyone else experiencing these problems?

# This works where there are image services in the MXD
for myDataSource in uniqueDataSourceList:
    mxd.replaceWorkspaces(myDataSource, "SDE_WORKSPACE", outputGDB, "SDE_WORKSPACE")
mxd.saveACopy(outputMXD, '9.3')

# This crashes if there are images services in the MXD
for myDataSource in uniqueDataSourceList:
    mxd.replaceWorkspaces(myDataSource, "SDE_WORKSPACE", outputGDB, "SDE_WORKSPACE", False)
mxd.saveACopy(outputMXD, '9.3')
0 Kudos
RandyKreuziger
Occasional Contributor III
Yes.  NIM060315


Unfortunately, this bug is not among the listed bug fixes for SP1  😞
0 Kudos