Is it possible to change the parameters highlighted in the screenshot below? If so which ArcPy function would do this? I know about and do not want to use the function that references .sde files on C:\ In the example below AUWEISQL1 will change I want to AUWEISQL3.
1 Answer
In ArcGIS, you add your resources such as feature classes and tables from an enterprise geodatabase stored in a DBMS by using connection files (they have .sde extension). If you need to change the data source of a layer, you need to supply another .sde connection that will have a different server specified.
You cannot change the server you highlighted, because it's a part of the connection configuration which is found in the .sde connection file.
The Source tab shows the information retrieved from the .sde connection file, and you need to modify the connection file itself to make your layer reference another table or another server.
Look at the lyr.workspacePath (access workspacePath of the Map Layer object) which will return a path to .sde connection file:
'C:\\Users\\username\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\[email protected]' As you have mentioned, you could use findAndReplaceWorkspacePath or replaceDataSource methods to modify the data sources for your layers.
- I had an inkling servers cannot be simply changed as it references the .sde file on each PC. Thankyou Alex for this answerHeathM– HeathM2015-12-12 03:30:44 +00:00Commented Dec 12, 2015 at 3:30
