Compare Replica Schema (Data Management)

Summary

Generates an .xml file that describes schema differences between a replica geodatabase and the relative replica geodatabase.

Usage

  • Modifying the schema of a replica to match the schema of a relative replica is a separate process from data synchronization. Use the following tools for this purpose:

    • Use the Compare Replica Schema tool to generate an .xml file containing the schema changes.
    • Import the changes using the Import Replica Schema tool.
    • To apply replica schema changes, run the Export Replica Schema tool to export the schema of the replica with the changes to an .xml file. Then use the .xml file as input to the Compare Replica Schema tool.

  • The output replica schema changes file must be in XML format.

Parameters

LabelExplanationData Type
Compare to Replica Geodatabase

The replica geodatabase to which the replica schema will be compared. The geodatabase can be a local geodatabase or a geodata service.

Workspace; GeoDataServer
Relative Replica Schema File

The file that contains the relative replica schema that will be used for the comparison.

File
Output Replica Schema Changes File

The file that will contain a description of the schema differences.

File

arcpy.management.CompareReplicaSchema(in_geodatabase, in_source_file, output_replica_schema_changes_file)
NameExplanationData Type
in_geodatabase

The replica geodatabase to which the replica schema will be compared. The geodatabase can be a local geodatabase or a geodata service.

Workspace; GeoDataServer
in_source_file

The file that contains the relative replica schema that will be used for the comparison.

File
output_replica_schema_changes_file

The file that will contain a description of the schema differences.

File

Code sample

CompareReplicaSchema example 1 (Python window)

The following script demonstrates how to use the CompareReplicaSchema function in the Python window.

import arcpy
arcpy.env.workspace = "C:/Data"
arcpy.management.CompareReplicaSchema("MySDEdata.sde", "RelativeReplicaSchema.xml", "SchemaComparison.xml")
CompareReplicaSchema example 2 (stand-alone script)

The following script demonstrates how to use the CompareReplicaSchema function in a stand-alone Python script.

# Description: Compare a replica schema (in an enterprise geodatabase 
#              workspace) to its relative replicas schema (in an .xml file).
#              The results of the comparison are created in an .xml file.
#              The relative replica's .xml schema file was created using the 
#              ExportReplicaSchema function.

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/Data"

# Set local variables
in_geodatabase = "MySDEdata.sde"
in_source_file = "RelativeReplicaSchema.xml"
output_schema_changes = "outputSchemaChanges.xml"

# Run CompareReplicaSchema
arcpy.management.CompareReplicaSchema(in_geodatabase, in_source_file, output_schema_changes)

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics