<?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 change version updateConnectionProperties in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/change-version-updateconnectionproperties/m-p/839969#M4614</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok so I am doing something wrong here.&amp;nbsp; I am trying to change the version of a layer using the python command line.&lt;/P&gt;&lt;P&gt;I don't want to use change version from the versioning toolbar because that does all of the layer in all for the maps.&lt;/P&gt;&lt;P&gt;The supplied sde connection points to a different version as specified in the geodatabase properties.&amp;nbsp; I uses easy connect syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;apr = arcpy.mp.ArcGISProject('current')&lt;/P&gt;&lt;P&gt;map3 = apr.listMaps("Map3")[0]&lt;/P&gt;&lt;P&gt;ptLayer = map3.listLayers()[0]&lt;/P&gt;&lt;P&gt;ptLayer.connectionProperties&lt;/P&gt;&lt;P&gt;{'dataset': 'XXX.XXXPoint', 'workspace_factory': 'SDE', 'connection_info': {'password': '&amp;lt;*********&amp;gt;', 'server': 'XXX.XXX.XX.XX.XX', 'instance': 'sde:oracle$XXX.XXX.XX.XX.XX:XXXX/XXX.XXX.XX.XX.XX', 'authentication_mode': 'OSA', 'version': 'XXX.&lt;STRONG&gt;Atlantic Week 26&lt;/STRONG&gt;'}}&lt;/P&gt;&lt;P&gt;ptLayer.updateConnectionProperties(ptLayer.connectionProperties, r'C:\xxx\ArcGIS\Project\Demo\xxx_Reg_Week26.sde')&lt;/P&gt;&lt;P&gt;ptLayer.connectionProperties&lt;/P&gt;&lt;P&gt;{'dataset': 'XXX.XXXPoint', 'workspace_factory': 'SDE', 'connection_info': {'password': '&amp;lt;*********&amp;gt;', 'server': 'XXX.XXX.XX.XX.XX', 'instance': 'sde:oracle$XXX.XXX.XX.XX.XX:XXXX/XXX.XXX.XX.XX.XX', 'authentication_mode': 'OSA', 'version': 'XXX.&lt;STRONG&gt;Atlantic Week 26&lt;/STRONG&gt;'}}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 May 2016 18:35:45 GMT</pubDate>
    <dc:creator>AlexanderGray</dc:creator>
    <dc:date>2016-05-19T18:35:45Z</dc:date>
    <item>
      <title>change version updateConnectionProperties</title>
      <link>https://community.esri.com/t5/geodatabase-questions/change-version-updateconnectionproperties/m-p/839969#M4614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok so I am doing something wrong here.&amp;nbsp; I am trying to change the version of a layer using the python command line.&lt;/P&gt;&lt;P&gt;I don't want to use change version from the versioning toolbar because that does all of the layer in all for the maps.&lt;/P&gt;&lt;P&gt;The supplied sde connection points to a different version as specified in the geodatabase properties.&amp;nbsp; I uses easy connect syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;apr = arcpy.mp.ArcGISProject('current')&lt;/P&gt;&lt;P&gt;map3 = apr.listMaps("Map3")[0]&lt;/P&gt;&lt;P&gt;ptLayer = map3.listLayers()[0]&lt;/P&gt;&lt;P&gt;ptLayer.connectionProperties&lt;/P&gt;&lt;P&gt;{'dataset': 'XXX.XXXPoint', 'workspace_factory': 'SDE', 'connection_info': {'password': '&amp;lt;*********&amp;gt;', 'server': 'XXX.XXX.XX.XX.XX', 'instance': 'sde:oracle$XXX.XXX.XX.XX.XX:XXXX/XXX.XXX.XX.XX.XX', 'authentication_mode': 'OSA', 'version': 'XXX.&lt;STRONG&gt;Atlantic Week 26&lt;/STRONG&gt;'}}&lt;/P&gt;&lt;P&gt;ptLayer.updateConnectionProperties(ptLayer.connectionProperties, r'C:\xxx\ArcGIS\Project\Demo\xxx_Reg_Week26.sde')&lt;/P&gt;&lt;P&gt;ptLayer.connectionProperties&lt;/P&gt;&lt;P&gt;{'dataset': 'XXX.XXXPoint', 'workspace_factory': 'SDE', 'connection_info': {'password': '&amp;lt;*********&amp;gt;', 'server': 'XXX.XXX.XX.XX.XX', 'instance': 'sde:oracle$XXX.XXX.XX.XX.XX:XXXX/XXX.XXX.XX.XX.XX', 'authentication_mode': 'OSA', 'version': 'XXX.&lt;STRONG&gt;Atlantic Week 26&lt;/STRONG&gt;'}}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 18:35:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/change-version-updateconnectionproperties/m-p/839969#M4614</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2016-05-19T18:35:45Z</dc:date>
    </item>
  </channel>
</rss>

