Select to view content in your preferred language

Replacing SDE connection in MXD's

2242
0
09-06-2013 01:27 PM
LorindaGilbert
Frequent Contributor
Hi All,
Like many before me (and yes, I have perused the forums looking for pointers) I am having to change servers for one of the several SDE databases.  I would like to have a script that can be run either from python or as a GP script in ArcCatalog.

We have several mxd's that are in the same folder (as well as several folders with individual mxds) that need to be updated.  I have grabbed code from several others that have done the same thing and attempted to get the end result as desired to no avail.  I'm getting the saved second copy of the mxd in another directory and a partial output file telling me what it is doing (or not doing).  The output file lists the mxd, the full path, and dataframe.  I'd like to get the layers listed if they are part of the changing database and then have the datasource changed for each of those layers.

We are only changing the server location of the database, the name and structure is remaining the same.  I will be creating a sde connection file to pass to everyone (we use AD groups with windows login) to be placed in the ArcCatalog directory in the appdata directory for each user.

I've tried several things, but it appears that it isn't getting past the layer list right now - yet, this was working when I had it just reporting back to me the listings.  I'm also aware of the 'feature' where using ArcCatalog to change the data source in the mxd doesn't work as advertised.

When I run this script, the only info returned besides the incomplete listing of data is, "returned exit code 0".

Running ArcDesktop 10.0 SP2, SDE 9.3.1, Python 2.6

Thanks for any insight that can be offered.  And I realize that it could be a simple typo or misplaced quote or something, but I just don't see it.
Tags (2)
0 Kudos
0 Replies