syncreplicas

RPLib – syncreplicas

RPLib.syncreplicas(ParentGDB=None, ChildGDB=None, ReplicaName=None, GDB1_TO_2=True, FAVOR_GDB1=True, BY_OBJECT=True, DO_NOT_RECONCILE=True)[source]

Synchronizes updates between two replica geodatabases in a direction specified by the user.

Parameter Type Description Required
ParentGDB String The geodatabase hosting the replica to synchronize, may be local or remote. Yes
ChildGDB String The geodatabase hosting the relative replica, geodatabase may be local or remote. Yes
ReplicaName String A valid replica with a parent contained within one input geodatabase and a child in the other input geodatabase. Yes
GDB1_TO_2 Boolean

The direction in which you want changes to be sent from geodatabase 1 to geodatabase 2, from geodatabase 2 to geodatabase 1, or to send changes in both directions. For check-out/check-in replicas or one-way replicas there is only one appropriate direction. If the replica is two-way then any of the three choices are available.

  • True = FROM_GEODATABASE1_TO_2 -Parent to Child. (Default)
  • False = FROM_GEODATABASE2_TO_1 -Child to Parent.
  • “BOTH” = BOTH_DIRECTIONS (overrides Boolean)
No
FAVOR_GDB1 Boolean

Specifies how conflicts are resolved when they are encountered.

  • True = IN_FAVOR_OF_GDB1 -Conflicts resolve in favor of the PARENTGDB. (Default)
  • False = IN_FAVOR_OF_GDB2 -Conflicts resolve in favor of the CHILDGDB.
  • “MANUAL” = MANUAL, Manually resolve conflicts in the versioning environment. (overrides Boolean)
No
BY_OBJECT Boolean

Specifies how you would like to define conflicts.

  • True = BY_OBJECT -Detects conflicts by row. (Default)
  • False = BY_ATTRIBUTE -Detects conflicts by column.
No
DO_NOT_RECONCILE Boolean

Indicates whether to automatically reconcile once data changes are sent to the parent replica if there are no conflicts present. This option is only available for check-out/check-in.

  • True = DO_NOT_RECONCILE -Do not reconcile. (Default)
  • False = RECONCILE -Reconcile
No

Returns: Boolean

Usage

  • Only works with enterprise geodatabases.
  • The reconcile process requires that you have full permissions to all the feature classes that have been modified in the version being edited.
  • The reconcile process detects differences between the edit version and the target version and flags these differences as conflicts. If conflicts exist, they should be resolved.
  • After running the reconcile process successfully with the, all_versions = True, all vesions in the geodatabase will appear the same.

Example 1

Simple call with all parameters specified.

import RPLib

# Local variables
ParentGDB = "C:/GIS/GISADMIN@GIS.sde"
ChildGDB = "Z:/LandRecords.gdb"
RepName = "GISReplica"

RPLib.syncreplicas(ParentGDB,ChildGDB,RepName,True,True,True,True)

Example 2

Simple call with only required parameters specified.

import RPLib

# Local variables
ParentGDB = "C:/GIS/GISADMIN@GIS.sde"
ChildGDB = "Z:/LandRecords.gdb"
RepName = "GISReplica"

RPLib.syncreplicas(ParentGDB,ChildGDB,RepName)

Example 3

If Else logic with all parameters specified.

import RPLib

# Local variables
ParentGDB = "C:/GIS/GISADMIN@GIS.sde"
ChildGDB = "Z:/LandRecords.gdb"
RepName = "GISReplica"

if RPLib.syncreplicas(ParentGDB,ChildGDB,RepName,True,True,True,True):
    print("successful, run another tool")
else:
    print("failed, run another tool")

Example 4

Notice you do not need to specify these parameters because by default:
  • GDB1_TO_2 = True
  • FAVOR_GDB1 = True
  • BY_OBJECT = True
  • DO_NOT_RECONCILE = True
import RPLib

# Local variables
ParentGDB = "C:/GIS/GISADMIN@GIS.sde"
ChildGDB = "Z:/LandRecords.gdb"
RepName = "GISReplica"

if RPLib.syncreplicas(ParentGDB,ChildGDB,RepName):
    print("successful, run another tool")
else:
    print("failed, run another tool")

Table Of Contents

Previous topic

truncateappend

Next topic

controlservices

This Page