AnsweredAssumed Answered

Update SDE Connection Properties in ArcGIS Pro Project Via ArcPy

Question asked by clintglover15 on Jun 4, 2019
Latest reply on Jul 12, 2019 by sarslan

Currently within my organization, password rules have been put in place that requires us to update our Oracle passwords every 90 days.  Due to these rules, I am in the process of creating a python script for both ArcMap mxds and ArcGIS Pro projects.  We currently have our SDE connection files in a shared directory to make this process easier.  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.  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.

 

The ArcMap python script has been created and works correctly using the .replaceDataSource function.  When I began working on the ArcGIS Pro python script, I ran into issues using the updateConnectionProperties function for layers within a map in a ArcGIS Pro project that used SDE connection files in our shared directory.  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.  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.  None of ESRI's examples show using updateConnectionProperties to go from one SDE connection to another SDE connection file.  Does anyone know if this is possible or if there is an alternate route I can take to complete this task?  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).

Outcomes