<?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: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/1056810#M40823</link>
    <description>&lt;P&gt;Sorry I am just now noticing your response from Feb 2021.&amp;nbsp; So it appears I simply forgot to add more context to the solution response.&amp;nbsp; All issues with the Python not updating layers with joins and saving the Pro projects were fixed after I updated from Pro 2.3.3 to 2.4.1.&amp;nbsp; Something in the Pro update fixed the issues.&amp;nbsp; I will edit my solution response to reflect this as well.&amp;nbsp; I am currently running Pro 2.7.1 and have not tested this out in that version to ensure it still works with no issues.&lt;/P&gt;&lt;P&gt;I will say our organization is just now needing to utilize this Python for our Pro projects in our dev environment.&amp;nbsp; We will know for sure soon if this Python works like we need it to.&amp;nbsp; If anything needs to be changed I will let you know.&lt;/P&gt;</description>
    <pubDate>Tue, 11 May 2021 18:27:12 GMT</pubDate>
    <dc:creator>Clint_Glover</dc:creator>
    <dc:date>2021-05-11T18:27:12Z</dc:date>
    <item>
      <title>Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607520#M26977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently within my organization, password rules have been put in place that requires us to update our Oracle passwords every 90 days.&amp;nbsp; Due to these rules, I am in the process of creating a python script for both ArcMap mxds and ArcGIS Pro projects.&amp;nbsp; We currently have our SDE connection files in a shared directory to make this process easier.&amp;nbsp; When a password change is required, we update the Oracle password and then update the password for the associated SDE connection file in the shared directory.&amp;nbsp; Our intentions are to reuse the SDE connection files after a password changes, so our python scripts essentially should just reset each layer's connection info back to itself, which would then contain the updated password for the associated SDE file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ArcMap python script has been created and works correctly using the &lt;A href="http://desktop.arcgis.com/en/arcmap/10.6/analyze/arcpy-mapping/updatingandfixingdatasources.htm"&gt;.replaceDataSource&lt;/A&gt; function.&amp;nbsp; When I began working on the ArcGIS Pro python script, I ran into issues using the &lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/updatingandfixingdatasources.htm"&gt;updateConnectionProperties&lt;/A&gt; function for layers within a map in a ArcGIS Pro project that used SDE connection files in our shared directory.&amp;nbsp; I attempted to set the new SDE connection file for each layer back to itself (which works with the replaceDataSource function for ArcMap), due to the SDE connection file staying the same, with only the password being updated.&amp;nbsp; I have also attempted to reset each layer's connection properties to a completely new SDE file, but that doesn't appear to work either.&amp;nbsp; None of ESRI's examples show using updateConnectionProperties to go from one SDE connection to another SDE connection file.&amp;nbsp; Does anyone know if this is possible or if there is an alternate route I can take to complete this task?&amp;nbsp; For reference, I am using the latest version of ArcGIS Pro (2.3.3) and our SDE connection files are pointed to an Oracle database (12c).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2019 19:20:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607520#M26977</guid>
      <dc:creator>Clint_Glover</dc:creator>
      <dc:date>2019-06-04T19:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607521#M26978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am also trying to swich layer data sources from file geodatabase to&amp;nbsp;enterprise geodatabase.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;followed guidelines provided in&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/updatingandfixingdatasources.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Updating and fixing data sources&lt;/A&gt;. Unfortunately none of the&amp;nbsp;below samples worked for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;'C:\......\Test1.aprx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

m &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Scene1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
m&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateConnectionProperties&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;'C:\....\xxx.gdb'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\Temp\yyy.sde'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; aprx&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;'C:\......\Test.aprx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


find_dict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'connection_info'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'database'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'C:\\.....\\xxx.gdb'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  
             &lt;SPAN class="string token"&gt;'workspace_factory'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'File Geodatabase'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
replace_dict1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'connection_info'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'db_connection_properties'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.4.xx.xx/yyyy'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                    &lt;SPAN class="string token"&gt;'instance'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'sde:oracle:10.4.xx.xx/yyyy'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                    &lt;SPAN class="string token"&gt;'server'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.4.xx.xx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
replace_dict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'connection_info'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'authentication_mode'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'DBMS'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;                                                             
                     &lt;SPAN class="string token"&gt;'dbclient'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'oracle'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;                     
                     &lt;SPAN class="string token"&gt;'instance'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.4.xx.xx/yyyy'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;                     
                     &lt;SPAN class="string token"&gt;'password'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'****'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;                     
                     &lt;SPAN class="string token"&gt;'server'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.4.xx.xx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;                     
                     &lt;SPAN class="string token"&gt;'user'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'user'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;                     
                     &lt;SPAN class="string token"&gt;'version'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'sde.DEFAULT'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'workspace_factory'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SDE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

m &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Scene1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; m&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isFeatureLayer &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isBroken
        lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateConnectionProperties&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;find_dict&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replace_dict&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; aprx&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;'C:\.......\Test1.aprx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

m &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMaps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Scene1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
lyr1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; m&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Layer1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; m&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isFeatureLayer &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isBroken &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Layer2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        find_dict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'connection_info'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'database'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\.....\xxx.gdb'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
                 &lt;SPAN class="string token"&gt;'dataset'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'dataset1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
                 &lt;SPAN class="string token"&gt;'workspace_factory'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'File Geodatabase'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
        replace_dict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'connection_info'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'authentication_mode'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'DBMS'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                            &lt;SPAN class="string token"&gt;'database'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'C:\\Temp\\connection.sde'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                            &lt;SPAN class="string token"&gt;'db_connection_properties'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.4.xx.xx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                            &lt;SPAN class="string token"&gt;'dbclient'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'oracle'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                            &lt;SPAN class="string token"&gt;'instance'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.4.xx.xx/instance'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                            &lt;SPAN class="string token"&gt;'password'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'*****'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                            &lt;SPAN class="string token"&gt;'server'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'10.4.xx.xx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                            &lt;SPAN class="string token"&gt;'user'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'user'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                            &lt;SPAN class="string token"&gt;'version'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'sde.DEFAULT'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'dataset'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'schema.dataset1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'workspace_factory'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SDE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
        lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateConnectionProperties&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;find_dict&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replace_dict&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; aprx
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:01:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607521#M26978</guid>
      <dc:creator>Suleyman-Arslan</dc:creator>
      <dc:date>2021-12-12T02:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607522#M26979</link>
      <description>&lt;P&gt;I actually called ESRI tech support on this particular issue and below is the Python code ESRI gave me&amp;nbsp;as the solution to this issue. &amp;nbsp;Instead of resetting the connection properties to another sde connection file, this Python simply just updates the password for each layer.&amp;nbsp; After running some quick initial tests, it seems to work for me, with the exception of a layer that contains a join.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Python code ESRI provided&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, pprint
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps()[0]

for l in m.listLayers():
       conProp = l.connectionProperties
       conProp['connection_info']['password'] = '&amp;lt;new password&amp;gt;'
       l.updateConnectionProperties(l.connectionProperties, conProp)
p.save()


## This may work as wlel if they are sure that only their database layers are broken in the project.
##for l in m.listLayers():
##    if l.isBroken == 'True':
##       conProp = l.connectionProperties
##       conProp['connection_info']['password'] = 'sa'
##       l.updateConnectionProperties(l.connectionProperties, conProp)
##p.save()‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When there is a layer with a join, conProp can not find the 'connection_info', and this is due to it being split into two different sections, one for the layer's connection info and one for the connection info for the join.&amp;nbsp; From what I found, it looks like you access the connection info for the layer and the join with the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;conProp['source']['connection_info']['password']
conProp['destination']['connection_info']['password']‍‍&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I put it all together, it should look like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, pprint
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps()[0]

for l in m.listLayers():
       conProp = l.connectionProperties
       conProp['source']['connection_info']['password'] = '&amp;lt;new password&amp;gt;'
       conProp['destination']['connection_info']['password'] = '&amp;lt;new password&amp;gt;'
       l.updateConnectionProperties(l.connectionProperties, conProp)
p.save()


## This may work as wlel if they are sure that only their database layers are broken in the project.
##for l in m.listLayers():
##    if l.isBroken == 'True':
##       conProp = l.connectionProperties
##       conProp['connection_info']['password'] = 'sa'
##       l.updateConnectionProperties(l.connectionProperties, conProp)
##p.save()‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After making that change, the Python still did not work to fix those layers and/or save the Pro project in Pro 2.3.3.&amp;nbsp; It appears to run through the first layer of the map in the Pro project and then it stops with no errors or anything.&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&amp;nbsp; A&lt;SPAN&gt;ll of the issues with the Python listed above not updating layers with joins and saving the Pro projects were fixed after I updated from Pro 2.3.3 to 2.4.1.&amp;nbsp; Something in the Pro update fixed the issues.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 18:26:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607522#M26979</guid>
      <dc:creator>Clint_Glover</dc:creator>
      <dc:date>2021-05-11T18:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607523#M26980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not attempted to switch a layer's data source from a file geodatabase to an enterprise geodatabase so unfortunately I'm of no help to you in this particular situation.&amp;nbsp; If I get some spare time, I'll attempt it and will let you know what I find out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2019 11:17:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607523#M26980</guid>
      <dc:creator>Clint_Glover</dc:creator>
      <dc:date>2019-07-11T11:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607524#M26981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After spanding a lot of time with arcpy, I&amp;nbsp;developed my first add-in with&amp;nbsp;ArcGIS Pro SDK for changing data source. I changed data sources for hundreds of layers with add-in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jul 2019 13:58:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607524#M26981</guid>
      <dc:creator>Suleyman-Arslan</dc:creator>
      <dc:date>2019-07-12T13:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607525#M26982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Clint, thanks for posting. I had virtually the same issue&amp;nbsp;and started &lt;A _jive_internal="true" href="https://community.esri.com/thread/230916-updating-data-source-in-arcgis-pro-project-with-arcpy"&gt;this thread&lt;/A&gt;&amp;nbsp;a while back. In the end, I settled for your approach as well. That's so ESRI though! Instead of letting you replace one reference to an SDE file with&amp;nbsp;a reference to another SDE file, they tell you to hardcode a&amp;nbsp;password into the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you could just prompt for a password during execution. Somewhere I also have a snipped for reading in a password&amp;nbsp;without showing it. Could be that it only works with arcgis module&amp;nbsp;though. - Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2019 20:14:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607525#M26982</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2019-09-17T20:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607526#M26983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The join issue I noted above has been resolved when updating to ArcGIS Pro 2.4. I'm not sure exactly what the difference was but something in the update fixed it when running the script within Pro 2.4.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2019 17:56:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607526#M26983</guid>
      <dc:creator>Clint_Glover</dc:creator>
      <dc:date>2019-12-17T17:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607527#M26984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I totally agree.&amp;nbsp; Nothing ever seems straightforward with ESRI.&amp;nbsp; I'm not sure how we are going to handle it yet (not really using ArcGIS Pro just yet for publishing our web services), but we will come up with something in the near future.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2019 18:11:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607527#M26984</guid>
      <dc:creator>Clint_Glover</dc:creator>
      <dc:date>2019-12-17T18:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607528#M26985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you share the ArcGIS add-in?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2020 17:41:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/607528#M26985</guid>
      <dc:creator>ELIZABETH50</dc:creator>
      <dc:date>2020-04-15T17:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/1024822#M37071</link>
      <description>&lt;P&gt;Why is this the accepted answer when the author of this post clearly states that it still does not work?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 12:02:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/1024822#M37071</guid>
      <dc:creator>diaconori</dc:creator>
      <dc:date>2021-02-09T12:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/1024823#M37072</link>
      <description>&lt;P&gt;What's the accepted answer to this? Clint's answer is marked as the accepted answer yet he clearly states that it does not solve the problem.&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;I tried to change the SDE connection in ArcMap using Python 2.7 and the following function:&lt;/P&gt;&lt;PRE&gt;lyr.findAndReplaceWorkspacePath(old_path, new_path, True)&lt;/PRE&gt;&lt;P&gt;It works. You guys may want to consider using the ArcMap route even though it seems counter intuitive...&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 14:17:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/1024823#M37072</guid>
      <dc:creator>diaconori</dc:creator>
      <dc:date>2021-02-17T14:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/1056810#M40823</link>
      <description>&lt;P&gt;Sorry I am just now noticing your response from Feb 2021.&amp;nbsp; So it appears I simply forgot to add more context to the solution response.&amp;nbsp; All issues with the Python not updating layers with joins and saving the Pro projects were fixed after I updated from Pro 2.3.3 to 2.4.1.&amp;nbsp; Something in the Pro update fixed the issues.&amp;nbsp; I will edit my solution response to reflect this as well.&amp;nbsp; I am currently running Pro 2.7.1 and have not tested this out in that version to ensure it still works with no issues.&lt;/P&gt;&lt;P&gt;I will say our organization is just now needing to utilize this Python for our Pro projects in our dev environment.&amp;nbsp; We will know for sure soon if this Python works like we need it to.&amp;nbsp; If anything needs to be changed I will let you know.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 18:27:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/1056810#M40823</guid>
      <dc:creator>Clint_Glover</dc:creator>
      <dc:date>2021-05-11T18:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/1066776#M41845</link>
      <description>&lt;P&gt;The accepted answer does not provide a solution that works regardless of ArcGIS Pro's version number. We're running the latest version of ArcGIS Pro and the accepted answer does not work.&lt;/P&gt;&lt;P&gt;I've left a new reply on this thread with a working solution, however it does not include using ArcGIS Pro. I recommend that you accomplish the above through the ArcMap route. ConnectionProperties are simply just over-engineered and way too complex to work with.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:26:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/update-sde-connection-properties-in-arcgis-pro/m-p/1066776#M41845</guid>
      <dc:creator>diaconori</dc:creator>
      <dc:date>2021-06-10T08:26:02Z</dc:date>
    </item>
  </channel>
</rss>

