Updating SDE sources only

680
2
Jump to solution
05-17-2017 12:33 AM
DeanHowell1
Occasional Contributor III

Hello everyone,

We have a number of MXD's that have a combination of SDE layers and other sources. I am trying to figure out the best way to update only the SDE sources, in python, so we can change them from DEV to PROD but not update local sources.

I have found using the layer.replaceDataSource will change all in the layer and for some reason layer.findAndReplaceWorkspacePath is not working on some features.

Any advice would be very much appreciated.

Regards

Dean

0 Kudos
1 Solution

Accepted Solutions
MichaelVolz
Esteemed Contributor

I used layer.replaceDataSource to perform this automated work in the past.

To differentiate SDE layers, I used the .supports("SERVICEPROPERTIES") as a True (Y) for this query which means the layer originates in SDE.

You will also probably need to deal with group layers that have SDE layers in them so your python code needs to handle them as well.

View solution in original post

2 Replies
MichaelVolz
Esteemed Contributor

I used layer.replaceDataSource to perform this automated work in the past.

To differentiate SDE layers, I used the .supports("SERVICEPROPERTIES") as a True (Y) for this query which means the layer originates in SDE.

You will also probably need to deal with group layers that have SDE layers in them so your python code needs to handle them as well.

DeanHowell1
Occasional Contributor III

Thanks Michael, that worked a treat

0 Kudos