<?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: Python script to reconcile enterprise database version to default is not working in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-reconcile-enterprise-database/m-p/1550418#M73061</link>
    <description>&lt;P&gt;thank you ! That worked! Saves me a lot of time.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2024 13:09:50 GMT</pubDate>
    <dc:creator>GeorgeJonesRIGOV</dc:creator>
    <dc:date>2024-10-21T13:09:50Z</dc:date>
    <item>
      <title>Python script to reconcile enterprise database version to default is not working</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-reconcile-enterprise-database/m-p/1549975#M73055</link>
      <description>&lt;P&gt;Hi all, I'm trying to reconcile a checked out enterprise database to the default database version. Here is the code I have so far but does not work.&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;arcpy.env.overwriteOutput = True&lt;BR /&gt;arcpy.env.workspace =r'S:\PW\GIS\Map Requests\2023_07_YardWasteAprxProjectAndRefuseRoutes\xxxxxx03_PW_Edit.sde'&lt;BR /&gt;arcpy.ReconcileVersions_management (arcpy.env.workspace, "ALL_VERSIONS", "DBO.DEFAULT", "versionlist", "LOCK_ACQUIRED", "NO_ABORT", "BY_OBJECT", "FAVOR_EDIT_VERSION", "POST", "KEEP_VERSION", "reconcileLog")&lt;BR /&gt;fc = r'S:\PW\GIS\Map Requests\2023_07_YardWasteAprxProjectAndRefuseRoutes\xyzxyzx.sde\xyzxy.DBO.Routes\xyzxy.DBO.YardWasteRoutesBest2024'&lt;BR /&gt;arcpy.management.MakeFeatureLayer(fc, 'YardWasteStops','','')&lt;BR /&gt;arcpy.ChangeVersion_management('YardWasteStops','TRANSACTIONAL', 'DBO.xxEdit','')&lt;BR /&gt;arcpy.conversion.FeatureClassToFeatureClass('YardWasteStops',r'S:\xy\GIS\Map Requests\2023_07_YardWasteAprxProjectAndRefuseRoutes\YardwasteAprx.gdb','YardWasteStops')&lt;BR /&gt;print('done')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a result, I keep getting a log file saying "Warning: The reconcile process was not performed. The specified target version (dbo.DEFAULT) has no edit versions to reconcile with". This should not be the case. The dbo.DEFAULT is the parent version and the PW_Edit is the child version of this.&amp;nbsp; I am stumped as why is that the case.&lt;/P&gt;&lt;P&gt;Note i replaced the file path names with xyxyx for privacy.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 16:57:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-reconcile-enterprise-database/m-p/1549975#M73055</guid>
      <dc:creator>GeorgeJonesRIGOV</dc:creator>
      <dc:date>2024-10-18T16:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to reconcile enterprise database version to default is not working</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-reconcile-enterprise-database/m-p/1550207#M73057</link>
      <description>&lt;P&gt;Make sure DBO.PW_Edit exists. Also, make sure that the child version you are attempting to reconcile with DBO.DEFAULT is correct. Try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

# Set workspace to the geodatabase
arcpy.env.workspace = r'S:\PW\GIS\Map Requests\2023_07_YardWasteAprxProjectAndRefuseRoutes\xxxxxx03_PW_Edit.sde'
arcpy.env.overwriteOutput = True

# List all versions to verify the child version exists
versions = arcpy.da.ListVersions(arcpy.env.workspace)
for version in versions:
    print(version.name)

# Reconcile the child version "PW_Edit" with the parent "DBO.DEFAULT"
child_version = "PW_Edit"
try:
    arcpy.ReconcileVersions_management(
        arcpy.env.workspace,
        "ALL_VERSIONS",
        "DBO.DEFAULT",
        child_version,  # Ensure the correct child version name is provided
        "LOCK_ACQUIRED",
        "NO_ABORT",
        "BY_OBJECT",
        "FAVOR_EDIT_VERSION",
        "POST",
        "KEEP_VERSION",
        r'S:\PW\GIS\Map Requests\2023_07_YardWasteAprxProjectAndRefuseRoutes\reconcileLog.txt'  # Log file path
    )
    print("Reconciliation successful.")
except Exception as e:
    print(f"Reconciliation failed: {e}")

# After reconciliation
fc = r'S:\PW\GIS\Map Requests\2023_07_YardWasteAprxProjectAndRefuseRoutes\xyzxyzx.sde\xyzxy.DBO.Routes\xyzxy.DBO.YardWasteRoutesBest2024'
arcpy.management.MakeFeatureLayer(fc, 'YardWasteStops', '', '')
arcpy.ChangeVersion_management('YardWasteStops', 'TRANSACTIONAL', 'DBO.PW_Edit', '')
arcpy.conversion.FeatureClassToFeatureClass(
    'YardWasteStops',
    r'S:\xy\GIS\Map Requests\2023_07_YardWasteAprxProjectAndRefuseRoutes\YardwasteAprx.gdb',
    'YardWasteStops'
)
print('done')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 21:30:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-reconcile-enterprise-database/m-p/1550207#M73057</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2024-10-18T21:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to reconcile enterprise database version to default is not working</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-reconcile-enterprise-database/m-p/1550418#M73061</link>
      <description>&lt;P&gt;thank you ! That worked! Saves me a lot of time.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 13:09:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-reconcile-enterprise-database/m-p/1550418#M73061</guid>
      <dc:creator>GeorgeJonesRIGOV</dc:creator>
      <dc:date>2024-10-21T13:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to reconcile enterprise database version to default is not working</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-reconcile-enterprise-database/m-p/1552793#M73097</link>
      <description>&lt;P&gt;Glad it worked for you!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 14:29:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-reconcile-enterprise-database/m-p/1552793#M73097</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2024-10-28T14:29:34Z</dc:date>
    </item>
  </channel>
</rss>

