<?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 Re: updateConnectionProperties | Correct Path | Broken layer connection in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/updateconnectionproperties-correct-path-broken/m-p/1281841#M67501</link>
    <description>&lt;P&gt;I never managed to get the general "updateConnectionProperties" to work. Below the strategy that I finaly applied. An update of the connectionProperties per feature layer:&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(&lt;SPAN&gt;path_Template_aprxFile&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;for m in aprx.listMaps():&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;for layer in m.listLayers():&lt;BR /&gt;newCP = layer.connectionProperties&lt;BR /&gt;newCP['connection_info']['database'] = &lt;SPAN&gt;path_newDatabase&lt;/SPAN&gt;&lt;BR /&gt;layer.updateConnectionProperties(layer.connectionProperties, newCP)&lt;BR /&gt;aprx.saveACopy(&lt;SPAN&gt;path_New_aprxFile&lt;/SPAN&gt;)&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 14:27:53 GMT</pubDate>
    <dc:creator>RutgerDujardin</dc:creator>
    <dc:date>2023-04-24T14:27:53Z</dc:date>
    <item>
      <title>updateConnectionProperties | Correct Path | Broken layer connection</title>
      <link>https://community.esri.com/t5/python-questions/updateconnectionproperties-correct-path-broken/m-p/1267450#M67074</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying as well to use the updateConnectionProperties function. Just in its most basic form, linking a new file geodatabase to an existing .aprx. Old and new databases have exactly the same structure. In my case, the function changes correctly the path's within the .aprx file. But when I open the .aprx it gives my only broken layer connections. When I click the&amp;nbsp;red-exclamation mark and direct to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;exactly the same&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;location/feature class&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;it retrieves the data.&lt;/P&gt;&lt;P&gt;My question: Why does the red-exclamation mark appears if the path is set correctly? Why can't the .aprx file represent the data when opening it?&lt;/P&gt;&lt;P&gt;The code I'm using:&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(path_Template_aprxFile)&lt;/P&gt;&lt;P&gt;aprx.updateConnectionProperties(None, path_newDatabase)&lt;/P&gt;&lt;P&gt;aprx.saveACopy(path_New_aprxFile)&lt;/P&gt;&lt;P&gt;If anyone can help solving my problem, be welcome.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 09:49:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/updateconnectionproperties-correct-path-broken/m-p/1267450#M67074</guid>
      <dc:creator>RutgerDujardin</dc:creator>
      <dc:date>2023-03-14T09:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: updateConnectionProperties | Correct Path | Broken layer connection</title>
      <link>https://community.esri.com/t5/python-questions/updateconnectionproperties-correct-path-broken/m-p/1281841#M67501</link>
      <description>&lt;P&gt;I never managed to get the general "updateConnectionProperties" to work. Below the strategy that I finaly applied. An update of the connectionProperties per feature layer:&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject(&lt;SPAN&gt;path_Template_aprxFile&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;for m in aprx.listMaps():&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;for layer in m.listLayers():&lt;BR /&gt;newCP = layer.connectionProperties&lt;BR /&gt;newCP['connection_info']['database'] = &lt;SPAN&gt;path_newDatabase&lt;/SPAN&gt;&lt;BR /&gt;layer.updateConnectionProperties(layer.connectionProperties, newCP)&lt;BR /&gt;aprx.saveACopy(&lt;SPAN&gt;path_New_aprxFile&lt;/SPAN&gt;)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 14:27:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/updateconnectionproperties-correct-path-broken/m-p/1281841#M67501</guid>
      <dc:creator>RutgerDujardin</dc:creator>
      <dc:date>2023-04-24T14:27:53Z</dc:date>
    </item>
  </channel>
</rss>

