Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

hi we have conveyed our some servers which has ArcGIS application and SDE on it to another server and its ip has changed. now when i want to open my .mxd file it tries to connect remote SDE with old connection settings and Opening old works really takes long time consequently i want to change my database connection in .mxd file .

is there any fast way to change sde settings programmatically with not open the .mxd file in arcmap?

import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Users\arc\Desktop\election2011.mxd")
brklist = arcpy.mapping.ListBrokenDataSources(mxd)
print brklist

Above code realy takes along time. without this code i can open my .mxd file with same time above code and can change manually...

thks

share|improve this question
2  
I had the same issue recently, but the slow opening was due to too many SDE connections at the time, which resolved itself. However, it would have been very useful to redirect the layers to source an alternative ArcSDE geodatabase by running a Python script if only the Python script did not have to instantiate the mxd first. –  PolyGeo Jul 21 '11 at 1:53
    
do u have any example code for this? thnk u –  Aragon Jul 21 '11 at 6:51
1  
Sorry Aragon - because at 10.0 it takes forever to get the MXD open when its ArcSDE Connection has issues there seemed no point me writing code. It sounds like 10.1 will open that up as an option. In the meantime I think your best bet for example code, which would need to be run in advance of trying to open the maps with "broken" connections, is at help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/… –  PolyGeo Jul 21 '11 at 7:12
    
thnk u. if your sde is on remote machine , will we use the same method? mxd.findAndReplaceWorkspacePaths(r"C:\Project\Connection to Default.sde", r"C:\Project\Connection to Version1.sde") C:\Project\Connection to Version1.sde ? –  Aragon Jul 21 '11 at 14:09
1  
I think that as long as your second SDE Connection file references the remote machine then that should work. I've not tested this personally. –  PolyGeo Jul 21 '11 at 22:35
add comment

2 Answers 2

up vote 1 down vote accepted

We had this same problem with really sucks. The MXD tries for 15 minutes to find the old server before giving up. We got around this problem by giving a new server the old SDE server's IP address. The new server has nothing to do with GIS or databases. However, the MXD tries to connect then gives up right away once it sees that the SDE data source is no longer there. The MXD opens quickly with the broken layer icons so you can fix the data source on your own.

share|improve this answer
add comment

It looks like the answer to this one is No at ArcGIS 10.0, and Yes at ArcGIS 10.1 which appears likely to contain an ArcPy solution. For more information see the ArcGIS Idea called Deal with broken datasources in an MXD better

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.