mapDoc.save() fails after mapDoc.replaceWorkspaces() in MXD with ArcGIS Image Service

Discussion created by cbeyerhelm on Jan 16, 2014
Latest reply on Jan 28, 2014 by cbeyerhelm
Our organization is migrating from SDE 9.3.1 to SDE 10.1 which entails new SDE connection files.

I've developed a script tool that walks a directory tree looking for MXD files that have an old SDE connection, and then replaces the old SDE connection(s) with the new SDE connection(s) using the .replaceWorkspaces() method.

The script works totally as expeted except for MXDs that contain an ArcGIS Image Service raster layer.  In these situations, the SDE connection to the vector data is successfully replaced but, somehow, that process strips all of the properties from the Image Service layers!

In the attached image below, notice that the SDE connection has been updated to gdb01a as it should, but the Image Service layers are stripped of their source properties.  That causes the MXD to be un-savable when I apply the .save() method.

This seems quite bizarre to me.  Any explanations or remedies would be appreciated.  Thank you...