import arcpy,pprint # ## SGTomlins 3/27/24 aprfilenew = r'C:\SGT\ESRI\Python\ChangeSource\JMoulds4_out.aprx' # ## Set your ArcGIS Project to excute the code on. aprfilein = r'C:\SGT\ESRI\Python\ChangeSource\JMoulds4.aprx' p = arcpy.mp.ArcGISProject(aprfilein) # ## Execute the command to change the versions of the layers in the .aprx p.updateConnectionProperties(r'C:\SGT\ESRI\Python\ChangeSource\SAML@underdog-az@gis_prod_util.sde', r'C:\SGT\ESRI\Python\ChangeSource\SAML@tinker2019@gis_prod_util.sde') # ## Save a copy of the .aprx used in the code above. # ## p.saveACopy(r"C:\SGT\Projects\Portal_Data_Layers\SGT_Portal_Data_Layers\SGT_Portal_Data_Layers_save8.aprx") p.saveACopy(aprfilenew) print (".") print ("..") print ("...")