<?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: Using a reconcile / post in relation to web apps in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/using-a-reconcile-post-in-relation-to-web-apps/m-p/357700#M13774</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would I have to republish the feature service after the version gets deleted and recreated?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Feb 2018 18:27:28 GMT</pubDate>
    <dc:creator>JordanMiller4</dc:creator>
    <dc:date>2018-02-16T18:27:28Z</dc:date>
    <item>
      <title>Using a reconcile / post in relation to web apps</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/using-a-reconcile-post-in-relation-to-web-apps/m-p/357698#M13772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to figure out the best way to create web maps with editing capabilities for our operators out in the field. Similar to&amp;nbsp;a QA/QC type of situation. From what I've read and tried the only way to allow our operators editing access is by creating a version called [Operators] and publishing it with full editing&amp;nbsp;&lt;SPAN&gt;capabilities. Please correct me if there is a better way to do it. And the other thing is the reconcile / post maintenance script we have. The script does a full compression every 2 weeks. Essentially it's deleting all the versions. If it's deleting the version [Operator] does that mean the web map will not work?&amp;nbsp;Does anyone happen to know a&amp;nbsp;workflow that will be useful?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Software:&lt;/P&gt;&lt;P&gt;ArcGIS Enterprise 10.6&lt;/P&gt;&lt;P&gt;Portal 10.6&lt;/P&gt;&lt;P&gt;ArcMap 10.5&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy, time, smtplib, os

deleteVersions = True
arcpy.env.overwriteOutput = True
reconcileLog = r'C:\temp\Weekly_Reconcile_Log\Reconcile_Log.txt'

# set the workspace
arcpy.env.workspace = 'C:\Users\jnmiller\AppData\Roaming\ESRI\Desktop10.5\ArcCatalog\SDE.sde'

# Set a variable for the workspace
adminConn = arcpy.env.workspace

# Block new connections to the database.
print("The database is no longer accepting connections")
arcpy.AcceptConnections(adminConn, False)

# Wait 15 minutes
#time.sleep(900)

# Disconnect all users from the database.
print("Disconnecting all users")
arcpy.DisconnectUser(adminConn, "ALL")

# Get a list of versions to pass into the ReconcileVersions tool.
print("Getting list of all versions")
versionList = arcpy.ListVersions(adminConn)

for version in versionList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if 'default' in version.lower():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if 'dbo' in version.lower():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; defaultVersion = 'dbo.DEFAULT'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif 'sde' in version.lower():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; defaultVersion = 'sde.DEFAULT'


# Execute the ReconcileVersions tool.
print("Reconciling/posting/deleting all versions")
if deleteVersions:
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ReconcileVersions_management(adminConn, "ALL_VERSIONS", defaultVersion, versionList, "LOCK_ACQUIRED", "NO_ABORT", "BY_OBJECT", "FAVOR_EDIT_VERSION", "POST", "DELETE_VERSION", reconcileLog)
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reconcileMessage = "Reconcile failed:&amp;nbsp; " + arcpy.GetMessages() + ".&amp;nbsp; Check reconcilelog.txt file in the " + str(reconcileLog)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddWarning(reconcileMessage)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ReconcileVersions_management(adminConn, "ALL_VERSIONS", defaultVersion, versionList, "LOCK_ACQUIRED", "NO_ABORT", "BY_OBJECT", "FAVOR_EDIT_VERSION", "POST", "KEEP_VERSION", reconcileLog)
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reconcileMessage = "Reconcile failed:&amp;nbsp; " + arcpy.GetMessages() + ".&amp;nbsp; Check reconcilelog.txt file in the " + str(reconcileLog)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddWarning(reconcileMessage)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass
print("Completed Reconcile &amp;amp; Post")

# Run the compress tool. 
print("Running compress")
arcpy.Compress_management(adminConn)
print("Compress Completed")

# Allow the database to begin accepting connections again
print("Allow users to connect to the database again")
arcpy.AcceptConnections(adminConn, True)

print("Starting Rebuild Indexes")
# Get a list of all the datasets the user has access to.
# First, get all the stand alone tables, feature classes and rasters.
dataList = arcpy.ListTables() + arcpy.ListFeatureClasses() + arcpy.ListRasters()

# Next, for feature datasets get all of the datasets and featureclasses
# from the list and add them to the master list.
for dataset in arcpy.ListDatasets("", "Feature"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = os.path.join(adminConn,dataset)
&amp;nbsp;&amp;nbsp;&amp;nbsp; dataList += arcpy.ListFeatureClasses() + arcpy.ListDatasets()

# Get the user name for the workspace
userName = arcpy.Describe(adminConn).connectionProperties.user.lower()

# remove any datasets that are not owned by the connected user.
userDataList = [ds for ds in dataList if ds.lower().find(".%s." % userName) &amp;gt; -1]

# Execute rebuild indexes
# Note: to use the "SYSTEM" option the workspace user must be an administrator.
arcpy.RebuildIndexes_management(adminConn, "SYSTEM", userDataList, "ALL")
print('Rebuild Complete')

# Update statistics on the system tables
print("Updating statistics on the system tables")
# Execute analyze datasets
# Note: to use the "SYSTEM" option the workspace user must be an administrator.
arcpy.AnalyzeDatasets_management(adminConn, "SYSTEM", userDataList, "ANALYZE_BASE","ANALYZE_DELTA","ANALYZE_ARCHIVE")
print("Analyze Complete")

print("Finished.")
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/SP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;/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 16:43:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/using-a-reconcile-post-in-relation-to-web-apps/m-p/357698#M13772</guid>
      <dc:creator>JordanMiller4</dc:creator>
      <dc:date>2021-12-11T16:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using a reconcile / post in relation to web apps</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/using-a-reconcile-post-in-relation-to-web-apps/m-p/357699#M13773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jordan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe the service that was created from the Operator version will no longer work if that version no longer exists.&amp;nbsp; You could add onto the script to recreate the version after the compression.&amp;nbsp; See an example in the below link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.5/tools/data-management-toolbox/create-version.htm" title="http://desktop.arcgis.com/en/arcmap/10.5/tools/data-management-toolbox/create-version.htm"&gt;Create Version—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 18:02:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/using-a-reconcile-post-in-relation-to-web-apps/m-p/357699#M13773</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2018-02-16T18:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using a reconcile / post in relation to web apps</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/using-a-reconcile-post-in-relation-to-web-apps/m-p/357700#M13774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would I have to republish the feature service after the version gets deleted and recreated?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 18:27:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/using-a-reconcile-post-in-relation-to-web-apps/m-p/357700#M13774</guid>
      <dc:creator>JordanMiller4</dc:creator>
      <dc:date>2018-02-16T18:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using a reconcile / post in relation to web apps</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/using-a-reconcile-post-in-relation-to-web-apps/m-p/357701#M13775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will most likely have to restart the service.&amp;nbsp; Take a look at the following tool.&amp;nbsp; It is similar to the script your running but it also stops/starts your ArcGIS Server services:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/docs/DOC-9914-compress-geodatabase-tool"&gt;https://community.esri.com/docs/DOC-9914-compress-geodatabase-tool&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Feb 2018 19:07:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/using-a-reconcile-post-in-relation-to-web-apps/m-p/357701#M13775</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2018-02-16T19:07:51Z</dc:date>
    </item>
  </channel>
</rss>

