I manage to change my datasouce by right clicking on an mxd file and choosing a different sde database connection file as shown in the following image.
However When I try to do this using arcpy script the datasource it is not changed, but the new mxd is created (having the old datasource)
import arcpy mxd = arcpy.mapping.MapDocument(r"C:\Users\SMALIS\Documents\ArcGIS\pythonSwitchSource.mxd") mxd.findAndReplaceWorkspacePaths(r"Database Connections\sdeConnection1.sde",r"Database Connections\sdeConnection2.sde") mxd.saveACopy(r"C:\Users\SMALIS\Documents\ArcGIS\pythonSwitchSourceNEW.mxd") del mxd
Can somebody explain me why is that happening?
I use ArcGIS 10.2 for Desktop. Oracle 11g