<?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: Finding usable catalogpath for files in an enterprise gdb? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/finding-usable-catalogpath-for-files-in-an/m-p/1373535#M69708</link>
    <description>&lt;P&gt;Hmm. This might ask for a complete re-write of this part of my workflow. I've been using CIM to update, and having the actual path hard-coded has made the most sense so far since I'm also messing with file GDB and shapefile data.&lt;/P&gt;&lt;P&gt;The annoying thing is if you use the Python window in a different project and just list the catalogPath for the layer in the map, it'll give you the correct path that I'm looking for.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_0-1706029731721.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92526i58CCC659AB8D23D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_0-1706029731721.png" alt="AlfredBaldenweck_0-1706029731721.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But using the python window in the project itself or my scripting tool gives me this dumb temp file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_1-1706030071350.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92529i149D16AAE92FB8A8/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_1-1706030071350.png" alt="AlfredBaldenweck_1-1706030071350.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So clearly this information&amp;nbsp;&lt;EM&gt;can&lt;/EM&gt; be found, but no clue how to make it work.&lt;/P&gt;&lt;P&gt;Anyway, thanks. I'll play around and see what I get.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jan 2024 17:17:27 GMT</pubDate>
    <dc:creator>AlfredBaldenweck</dc:creator>
    <dc:date>2024-01-23T17:17:27Z</dc:date>
    <item>
      <title>Finding usable catalogpath for files in an enterprise gdb?</title>
      <link>https://community.esri.com/t5/python-questions/finding-usable-catalogpath-for-files-in-an/m-p/1373445#M69706</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to replace some datasources and I ran into the following issue with enterprise databases.&lt;/P&gt;&lt;P&gt;My replacements are in a dictionary of {oldsource: new source}.&lt;/P&gt;&lt;P&gt;The data is accessed through an SDE file, at T:\...\SDENAME.sde&lt;/P&gt;&lt;P&gt;So the catalogPath should be&amp;nbsp;T:\...\SDENAME.sde\gdb.owner.featureclass&lt;/P&gt;&lt;P&gt;However, the following is what arcpy.da.Describe["catalogPath"] returns:&lt;/P&gt;&lt;PRE&gt;C:\TMP\ArcGISProTemp13528\8850eb38373ef1ba0d601f80c13fcdef.sde\featureDataset\featureclass&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;My dictionary is&amp;nbsp;&lt;/P&gt;&lt;P&gt;{T:\...\SDENAME.sde\gdb.owner.featureclass&amp;nbsp;:&amp;nbsp;T:\...\SDENAME2.sde\gdb.owner.featureclass2} so this doesn't work for me.&lt;/P&gt;&lt;P&gt;I recall from other posts that this is normal, but I can't remember how to actually get a usable path that I want?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 15:12:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/finding-usable-catalogpath-for-files-in-an/m-p/1373445#M69706</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-01-23T15:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Finding usable catalogpath for files in an enterprise gdb?</title>
      <link>https://community.esri.com/t5/python-questions/finding-usable-catalogpath-for-files-in-an/m-p/1373467#M69707</link>
      <description>&lt;P&gt;I just ignore that temp path for the sde connection file. Use the &lt;A href="https://pro.arcgis.com/en/pro-app/3.1/arcpy/functions/workspace-properties.htm" target="_self"&gt;workspace properties&lt;/A&gt; to inspect the connection, find the appropriate dictionary key by comparing connection properties (not file path), and then &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm" target="_self"&gt;update the connection properties&lt;/A&gt;&amp;nbsp;from there.&lt;/P&gt;&lt;P&gt;For example, my common use is updating the database instance from test to production. You would be looking up the connection properties from your dictionary connections rather than hard coding the value, but you would still update the connection properties similarly.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for layer in map.listLayers():
    if layer.supports("connectionProperties"):
        cp = layer.connectionProperties
        for key, value in cp["connection_info"].items():
            cp["connection_info"][key] = value.replace("testInstance", "prodInstance")
        layer.updateConnectionProperties(layer.connectionProperties, cp)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Jan 2024 15:52:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/finding-usable-catalogpath-for-files-in-an/m-p/1373467#M69707</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2024-01-23T15:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Finding usable catalogpath for files in an enterprise gdb?</title>
      <link>https://community.esri.com/t5/python-questions/finding-usable-catalogpath-for-files-in-an/m-p/1373535#M69708</link>
      <description>&lt;P&gt;Hmm. This might ask for a complete re-write of this part of my workflow. I've been using CIM to update, and having the actual path hard-coded has made the most sense so far since I'm also messing with file GDB and shapefile data.&lt;/P&gt;&lt;P&gt;The annoying thing is if you use the Python window in a different project and just list the catalogPath for the layer in the map, it'll give you the correct path that I'm looking for.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_0-1706029731721.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92526i58CCC659AB8D23D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_0-1706029731721.png" alt="AlfredBaldenweck_0-1706029731721.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But using the python window in the project itself or my scripting tool gives me this dumb temp file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AlfredBaldenweck_1-1706030071350.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92529i149D16AAE92FB8A8/image-size/large?v=v2&amp;amp;px=999" role="button" title="AlfredBaldenweck_1-1706030071350.png" alt="AlfredBaldenweck_1-1706030071350.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So clearly this information&amp;nbsp;&lt;EM&gt;can&lt;/EM&gt; be found, but no clue how to make it work.&lt;/P&gt;&lt;P&gt;Anyway, thanks. I'll play around and see what I get.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 17:17:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/finding-usable-catalogpath-for-files-in-an/m-p/1373535#M69708</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-01-23T17:17:27Z</dc:date>
    </item>
  </channel>
</rss>

