Reconcile Versions (Data Management)

Summary

Reconciles a version or multiple versions with a target version.

Learn more about how to reconcile and post versions

Usage

  • The reconcile process requires that you are the only user currently editing the version and the only user who will edit the version throughout the reconcile process until you save or post.

  • The reconcile process requires that you have full permissions to all the feature classes that have been modified in the version being edited.

  • Versioning tools work with enterprise geodatabases. File geodatabases do not support versioning.

  • This tool supports reconcile and post operations for data published from a branch workspace with version management capabilities enabled. Reconcile and post operations for branch versioning using a geodatabase connection file are not supported.

  • License:
    When working with branch versioning in an ArcGIS Enterprise 11.2 or later deployment, organization members must be assigned a license for the ArcGIS Advanced Editing user type extension to use this tool.

Parameters

LabelExplanationData Type
Input Workspace

The enterprise geodatabase that contains the versions to be reconciled.

For branch versioning, this will be the feature service URL (that is, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer) or the feature layer portal item.

Workspace
Reconcile Mode

Specifies the versions that will be reconciled when the tool is run.

If the input is a branch workspace, the only valid option for this parameter is to reconcile all versions.

  • Reconcile all versionsEdit versions will be reconciled with the target version. This is the default.
  • Reconcile blocking versions onlyVersions that are blocking the target version from compressing will be reconciled. This option uses the recommended reconcile order.
String
Target Version
(Optional)

The name of any version in the direct ancestry of the edit version, such as the parent version or the default version.

It typically contains edits from other versions that you want included in the edit version.

If the input is a branch workspace, the only valid option for this parameter is to reconcile with the default version.

String
Edit Versions
(Optional)

The name of the edit version or versions to be reconciled with the selected target version.

Only versions that are in the direct ancestry of the selected target version will be displayed.

String
Acquire Locks
(Optional)

Specifies whether feature locks will be acquired.

If the input is a branch workspace, locks are not acquired during the reconcile process.

  • Checked—Locks will be acquired during the reconcile process. Use this option when the intention is to post edits. It ensures that the target version is not modified in the time between the reconcile and post operations. This is the default.
  • Unchecked—Locks will not be acquired during the reconcile process. This allows multiple users to reconcile in parallel. Use this option when the edit version will not be posted to the target version because the target version may be modified in the time between the reconcile and post operations.
Boolean
Abort if Conflicts Detected
(Optional)

Specifies whether the reconcile process will end if conflicts are found between the target version and the edit version during the reconcile process.

  • Checked—The reconcile will end if conflicts are found.
  • Unchecked—The reconcile will not end if conflicts are found. This is the default.
Boolean
Conflict Definition
(Optional)

Specifies whether the conditions required for a conflict to occur will be defined by object (row) or by attribute (column).

  • Conflicts defined by object (by row)Conflicts will be defined by object. Any changes to the same row or feature in the parent and child versions will conflict during reconcile. This is the default.
  • Conflicts defined by attribute (by column)Conflicts will be defined by attribute. Only changes to the same attribute (column) of the same row or feature in the parent and child versions will be flagged as a conflict during reconcile. Changes to other attributes will not be considered a conflict during reconcile.
String
Conflict Resolution
(Optional)

Specifies the resolution that will be used if a conflict is detected.

If the input is a branch workspace, the default is to favor the edit version.

  • Resolve conflicts in favor of the target versionAll conflicts will be resolved in favor of the target version. This is the default for traditional versioning.
  • Resolve conflicts in favor of the edit versionAll conflicts will be resolved in favor of the edit version. This is the default for branch versioning.
String
Post Versions After Reconcile
(Optional)

Specifies whether the current edit session will be posted to the reconciled target version.

  • Checked—The current edit version will be posted to the target version after the reconcile.
  • Unchecked—The current edit version will not be posted to the target version after the reconcile. This is the default.
Boolean
Delete Versions After Post
(Optional)

Specifies whether the reconciled edit version will be deleted after posting. This parameter only applies when the Post Versions After Reconcile parameter is checked.

  • Checked—The current edit version that was reconciled will be deleted after being posted to the target version.
  • Unchecked—The current edit version that was reconciled will not be deleted. This is the default.
Boolean
Reconcile Versions Log
(Optional)

The name and location where the log file will be written. The log file is an ASCII file containing the contents of the geoprocessing messages.

File
Proceed if unreviewed conflicts are detected
(Optional)

Specifies whether the reconcile will proceed if existing unreviewed conflicts are detected before the reconcile process starts. If you proceed, existing conflicts from previous sessions will be lost when the tool runs. This parameter is only applicable to branch versioning.

  • Checked—The reconcile process will proceed if existing unreviewed conflicts are detected. This is the default.
  • Unchecked—The reconcile process will not proceed if existing unreviewed conflicts are detected.
Boolean
Reconcile checkout replica versions
(Optional)

Specifies whether the reconcile process will include checkout replica versions. If you are creating a checkout replica as part of a geodatabase replication workflow, an associated version is created in the geodatabase. This option allows you to include or remove these types of versions from the list of versions to be reconciled. This parameter is not applicable to branch versioning.

  • Checked—The reconcile process will include checkout replica versions. This is the default.
  • Unchecked—The reconcile process will not include checkout replica versions.

Boolean

Derived Output

LabelExplanationData Type
Updated Input Workspace

The updated input workspace.

Workspace

arcpy.management.ReconcileVersions(input_database, reconcile_mode, {target_version}, {edit_versions}, {acquire_locks}, {abort_if_conflicts}, {conflict_definition}, {conflict_resolution}, {with_post}, {with_delete}, {out_log}, {proceed_if_conflicts_not_reviewed}, {reconcile_checkout_versions})
NameExplanationData Type
input_database

The enterprise geodatabase that contains the versions to be reconciled. The default is to use the geoprocessing Current Workspace environment.

For branch versioning, this will be the feature service URL (that is, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer).

Workspace
reconcile_mode

Specifies the versions that will be reconciled when the tool is run.

If the input is a branch workspace, the only valid option for this parameter is to reconcile all versions.

  • ALL_VERSIONSEdit versions will be reconciled with the target version. This is the default.
  • BLOCKING_VERSIONSVersions that are blocking the target version from compressing will be reconciled. This option uses the recommended reconcile order.
String
target_version
(Optional)

The name of any version in the direct ancestry of the edit version, such as the parent version or the default version.

It typically contains edits from other versions that you want included in the edit version.

If the input is a branch workspace, the only valid option for this parameter is to reconcile with the default version.

String
edit_versions
[edit_versions,...]
(Optional)

The name of the edit version or versions to be reconciled with the selected target version. This can be an individual version name or a list of version names.

String
acquire_locks
(Optional)

Specifies whether feature locks will be acquired.

If the input is a branch workspace, locks are not acquired during the reconcile process.

  • LOCK_ACQUIREDLocks will be acquired during the reconcile process. Use this option when the intention is to post edits. It ensures that the target version is not modified in the time between the reconcile and post operations. This is the default.
  • NO_LOCK_ACQUIREDLocks will not be acquired during the reconcile process. This allows multiple users to reconcile in parallel. Use this option when the edit version will not be posted to the target version because the target version may be modified in the time between the reconcile and post operations.
Boolean
abort_if_conflicts
(Optional)

Specifies whether the reconcile process will end if conflicts are found between the target version and the edit version during the reconcile process.

  • NO_ABORTThe reconcile will not end if conflicts are found. This is the default.
  • ABORT_CONFLICTSThe reconcile will end if conflicts are found.
Boolean
conflict_definition
(Optional)

Specifies whether the conditions required for a conflict to occur will be defined by object (row) or by attribute (column).

  • BY_OBJECTConflicts will be defined by object. Any changes to the same row or feature in the parent and child versions will conflict during reconcile. This is the default.
  • BY_ATTRIBUTEConflicts will be defined by attribute. Only changes to the same attribute (column) of the same row or feature in the parent and child versions will be flagged as a conflict during reconcile. Changes to other attributes will not be considered a conflict during reconcile.
String
conflict_resolution
(Optional)

Specifies the resolution that will be used if a conflict is detected.

If the input is a branch workspace, the default is to favor the edit version.

  • FAVOR_TARGET_VERSIONAll conflicts will be resolved in favor of the target version. This is the default for traditional versioning.
  • FAVOR_EDIT_VERSIONAll conflicts will be resolved in favor of the edit version. This is the default for branch versioning.
String
with_post
(Optional)

Specifies whether the current edit session will be posted to the reconciled target version.

  • NO_POSTThe current edit version will not be posted to the target version after the reconcile. This is the default.
  • POSTThe current edit version will be posted to the target version after the reconcile.
Boolean
with_delete
(Optional)

Specifies whether the reconciled edit version will be deleted after posting. This parameter only applies when the with_post parameter is set to POST.

  • DELETE_VERSIONThe current edit version that was reconciled will be deleted after being posted to the target version.
  • KEEP_VERSIONThe current edit version that was reconciled will not be deleted. This is the default.
Boolean
out_log
(Optional)

The name and location where the log file will be written. The log file is an ASCII file containing the contents of the geoprocessing messages.

File
proceed_if_conflicts_not_reviewed
(Optional)

Specifies whether the reconcile will proceed if existing unreviewed conflicts are detected before the reconcile process starts. If you proceed, existing conflicts from previous sessions will be lost when the tool runs. This parameter is only applicable to branch versioning.

  • PROCEEDThe reconcile process will proceed if existing unreviewed conflicts are detected. This is the default.
  • NOT_PROCEEDThe reconcile process will not proceed if existing unreviewed conflicts are detected.
Boolean
reconcile_checkout_versions
(Optional)

Specifies whether the reconcile process will include checkout replica versions. If you are creating a checkout replica as part of a geodatabase replication workflow, an associated version is created in the geodatabase. This option allows you to include or remove these types of versions from the list of versions to be reconciled. This parameter is not applicable to branch versioning.

  • RECONCILEThe reconcile process will include checkout replica versions. This is the default.
  • DO_NOT_RECONCILEThe reconcile process will not include checkout replica versions.
Boolean

Derived Output

NameExplanationData Type
out_workspace

The updated input workspace.

Workspace

Code sample

ReconcileVersions example (stand-alone script)

The following stand-alone script demonstrates how to use the ReconcileVersions function to reconcile all versions owned by the user specified in the database connection file.

# Name: ReconcileVersions.py
# Description: Reconciles all versions owned by a user with SDE.Default

# Import system modules
import arcpy, os

# Set workspace
workspace = 'C:/Data/connections/bender@production.sde'

# Set the workspace environment
arcpy.env.workspace = 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() != 'sde.default']

arcpy.ReconcileVersions_management(workspace,
                                   "ALL_VERSIONS",
                                   "SDE.Default",
                                   verList,
                                   "LOCK_ACQUIRED",
                                   "NO_ABORT",
                                   "BY_OBJECT",
                                   "FAVOR_TARGET_VERSION",
                                   "NO_POST",
                                   "KEEP_VERSION",
                                   "c:\RecLog.txt")
print('Reconciling Complete')

Environments

Licensing information

  • Basic: No
  • Standard: Limited
  • Advanced: Limited

Related topics