<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic updateConnectionProperties in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/updateconnectionproperties/m-p/172692#M7743</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to update layer connection from one oracle geodatabase to another oracle geodatabase.&amp;nbsp; I also tried with the same geodatabase with different versions but none of it works.&amp;nbsp; I tried in the pro python window with the arcpy.mp.ArcGISProject("current") and from my python ide (VS) which runs idle.&amp;nbsp;&amp;nbsp; I would like to use this to change the version of some layers (change version does the whole aprx, not what I want) or the database dev, staging, uat, training, production.&amp;nbsp; What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; This is the code&lt;/P&gt;&lt;P&gt;import sys&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;#test project with a single map and a single layer&lt;/P&gt;&lt;P&gt;apr = arcpy.mp.ArcGISProject(r"C:\xxx\ArcGIS\Project\testChangeConnection\testChangeConnection.aprx")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map = apr.listMaps()[0]&lt;/P&gt;&lt;P&gt;lay = map.listLayers()[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#development geodatabase 10.3.1 using an easy connect&lt;/P&gt;&lt;P&gt;devDb = r"C:\xxx\ArcGIS\Project\testChangeConnection\dev.sde"&lt;/P&gt;&lt;P&gt;#staging gdb is also 10.3.1 TNSNames connection because of TAF but also tried with easy connect to another db.&lt;/P&gt;&lt;P&gt;#featureclass with same name, type, schema, coordsys and data exists in both databases&lt;/P&gt;&lt;P&gt;stgDb = r"C:\xxx\ArcGIS\Project\testChangeConnection\stg.sde"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print(lay.connectionProperties) #prints connection to dev&lt;/P&gt;&lt;P&gt;apr.updateConnectionProperties(devDb ,stgDb, True, True)&lt;/P&gt;&lt;P&gt;apr.save()&lt;/P&gt;&lt;P&gt;print(lay.connectionProperties)&amp;nbsp; #prints connection to dev&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lay.updateConnectionProperties(lay.connectionProperties ,stgDb, True, True)&lt;/P&gt;&lt;P&gt;#prints connection to dev&lt;/P&gt;&lt;P&gt;print(lay.connectionProperties) #prints connection to dev&lt;/P&gt;&lt;P&gt;apr.save&lt;/P&gt;&lt;P&gt;del apr&lt;/P&gt;&lt;P&gt;print("done")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I open the aprx and the source of the layer is indeed not changed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jun 2016 15:53:58 GMT</pubDate>
    <dc:creator>AlexanderGray</dc:creator>
    <dc:date>2016-06-13T15:53:58Z</dc:date>
    <item>
      <title>updateConnectionProperties</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/updateconnectionproperties/m-p/172692#M7743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to update layer connection from one oracle geodatabase to another oracle geodatabase.&amp;nbsp; I also tried with the same geodatabase with different versions but none of it works.&amp;nbsp; I tried in the pro python window with the arcpy.mp.ArcGISProject("current") and from my python ide (VS) which runs idle.&amp;nbsp;&amp;nbsp; I would like to use this to change the version of some layers (change version does the whole aprx, not what I want) or the database dev, staging, uat, training, production.&amp;nbsp; What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; This is the code&lt;/P&gt;&lt;P&gt;import sys&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;#test project with a single map and a single layer&lt;/P&gt;&lt;P&gt;apr = arcpy.mp.ArcGISProject(r"C:\xxx\ArcGIS\Project\testChangeConnection\testChangeConnection.aprx")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map = apr.listMaps()[0]&lt;/P&gt;&lt;P&gt;lay = map.listLayers()[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#development geodatabase 10.3.1 using an easy connect&lt;/P&gt;&lt;P&gt;devDb = r"C:\xxx\ArcGIS\Project\testChangeConnection\dev.sde"&lt;/P&gt;&lt;P&gt;#staging gdb is also 10.3.1 TNSNames connection because of TAF but also tried with easy connect to another db.&lt;/P&gt;&lt;P&gt;#featureclass with same name, type, schema, coordsys and data exists in both databases&lt;/P&gt;&lt;P&gt;stgDb = r"C:\xxx\ArcGIS\Project\testChangeConnection\stg.sde"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print(lay.connectionProperties) #prints connection to dev&lt;/P&gt;&lt;P&gt;apr.updateConnectionProperties(devDb ,stgDb, True, True)&lt;/P&gt;&lt;P&gt;apr.save()&lt;/P&gt;&lt;P&gt;print(lay.connectionProperties)&amp;nbsp; #prints connection to dev&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lay.updateConnectionProperties(lay.connectionProperties ,stgDb, True, True)&lt;/P&gt;&lt;P&gt;#prints connection to dev&lt;/P&gt;&lt;P&gt;print(lay.connectionProperties) #prints connection to dev&lt;/P&gt;&lt;P&gt;apr.save&lt;/P&gt;&lt;P&gt;del apr&lt;/P&gt;&lt;P&gt;print("done")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I open the aprx and the source of the layer is indeed not changed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 15:53:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/updateconnectionproperties/m-p/172692#M7743</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2016-06-13T15:53:58Z</dc:date>
    </item>
  </channel>
</rss>

