<?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 Use Python scripting to batch reconcile and post versions - set the workspace in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/use-python-scripting-to-batch-reconcile-and-post/m-p/306598#M23823</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - i'm fairly new to python, but am working my way through this article&amp;nbsp;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.6/manage-data/geodatabases/using-python-scripting-to-batch-reconcile-and-post-versions.htm#ESRI_SECTION1_CAC3CB09C4584334BA3A4E4705439626" title="https://desktop.arcgis.com/en/arcmap/10.6/manage-data/geodatabases/using-python-scripting-to-batch-reconcile-and-post-versions.htm#ESRI_SECTION1_CAC3CB09C4584334BA3A4E4705439626"&gt;Use Python scripting to batch reconcile and post versions—ArcGIS Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; .&amp;nbsp; I am on the step "Rebuild indexes and update statistics" and I have to set the workspace environment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: green;"&gt;# set the workspace &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;env&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;workspace&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;"C:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;\\&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;Projects&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;\\&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;MyProject&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;\\&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;user1.sde"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #a31515;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #000000;"&gt;Where do i find the path like listed above for the gdb Owner?&amp;nbsp;&amp;nbsp;I have enterprise gdbs set up and there is one user who is the db owner.&amp;nbsp; Is this just the sde connection file location?&amp;nbsp; Or can i chose any folder location?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #000000;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #000000;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #000000;"&gt;Pamela&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #a31515;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Apr 2020 20:04:18 GMT</pubDate>
    <dc:creator>PamelaLocke1</dc:creator>
    <dc:date>2020-04-23T20:04:18Z</dc:date>
    <item>
      <title>Use Python scripting to batch reconcile and post versions - set the workspace</title>
      <link>https://community.esri.com/t5/python-questions/use-python-scripting-to-batch-reconcile-and-post/m-p/306598#M23823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - i'm fairly new to python, but am working my way through this article&amp;nbsp;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.6/manage-data/geodatabases/using-python-scripting-to-batch-reconcile-and-post-versions.htm#ESRI_SECTION1_CAC3CB09C4584334BA3A4E4705439626" title="https://desktop.arcgis.com/en/arcmap/10.6/manage-data/geodatabases/using-python-scripting-to-batch-reconcile-and-post-versions.htm#ESRI_SECTION1_CAC3CB09C4584334BA3A4E4705439626"&gt;Use Python scripting to batch reconcile and post versions—ArcGIS Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; .&amp;nbsp; I am on the step "Rebuild indexes and update statistics" and I have to set the workspace environment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: green;"&gt;# set the workspace &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;env&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;workspace&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;"C:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;\\&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;Projects&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;\\&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;MyProject&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;\\&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;user1.sde"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #a31515;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #000000;"&gt;Where do i find the path like listed above for the gdb Owner?&amp;nbsp;&amp;nbsp;I have enterprise gdbs set up and there is one user who is the db owner.&amp;nbsp; Is this just the sde connection file location?&amp;nbsp; Or can i chose any folder location?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #000000;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #000000;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #000000;"&gt;Pamela&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #a31515;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2020 20:04:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-python-scripting-to-batch-reconcile-and-post/m-p/306598#M23823</guid>
      <dc:creator>PamelaLocke1</dc:creator>
      <dc:date>2020-04-23T20:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Use Python scripting to batch reconcile and post versions - set the workspace</title>
      <link>https://community.esri.com/t5/python-questions/use-python-scripting-to-batch-reconcile-and-post/m-p/306599#M23824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll need a connection file with the owner creds to do that; depending on how you set up your enterprise (sde) the SDE user is the guy that does that operation as I recall.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2020 20:32:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-python-scripting-to-batch-reconcile-and-post/m-p/306599#M23824</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-04-23T20:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Use Python scripting to batch reconcile and post versions - set the workspace</title>
      <link>https://community.esri.com/t5/python-questions/use-python-scripting-to-batch-reconcile-and-post/m-p/306600#M23825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is one i use. &lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/reconcile-versions.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/reconcile-versions.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Reconcile Versions—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;# Set workspace
arcpy.env.workspace = r'C:\Users\####\AppData\Roaming\ESRI\Desktop10.6\ArcCatalog\Connection to ####.sde'

# Set the workspace environment
workspace = arcpy.env.workspace

# Use a list comprehension to get a list of version names where the owner
# is the current user and make sure sde.default is not selected.
#verList = [ver.name for ver in arcpy.da.ListVersions() if ver.isOwner
          # == True and ver.name.lower() != '####']

arcpy.ReconcileVersions_management(workspace,
                                   "ALL_VERSIONS",
                                   "#####",
                                   "#####",
                                   "LOCK_ACQUIRED",
                                   "NO_ABORT",
                                   "BY_OBJECT",
                                   "FAVOR_EDIT_VERSION",
                                   "POST",
                                   "KEEP_VERSION",
                                   "c:\Temp\RecLog.txt")
print ('Reconciling Complete')‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:40:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-python-scripting-to-batch-reconcile-and-post/m-p/306600#M23825</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2021-12-11T14:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Use Python scripting to batch reconcile and post versions - set the workspace</title>
      <link>https://community.esri.com/t5/python-questions/use-python-scripting-to-batch-reconcile-and-post/m-p/306601#M23826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can build the connection on the fly in your code if you like. But it is simplest to just create one ahead of time as Joe suggested.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The python way:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/create-database-connection.htm" title="https://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/create-database-connection.htm"&gt;Create Database Connection—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or in ArcCatalog:&lt;/P&gt;&lt;P&gt;- right-click on a folder and select New &amp;gt; Database Connection...&lt;/P&gt;&lt;P&gt;- then you will need the user name and password etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Apr 2020 01:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/use-python-scripting-to-batch-reconcile-and-post/m-p/306601#M23826</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2020-04-25T01:05:37Z</dc:date>
    </item>
  </channel>
</rss>

