Import Replica Schema (Data Management)

Summary

Applies replica schema differences using an input replica geodatabase and an XML schema file.

Usage

  • The input replica schema changes file must be XML.

  • 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.

Parameters

LabelExplanationData Type
Import to Replica Geodatabase

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

Workspace; GeoDataServer
Replica Schema Changes File

The file that contains the replica schema differences that will be imported.

File

Derived Output

LabelExplanationData Type
Output Replica Workspace

The updated replica geodatabase.

Workspace

arcpy.management.ImportReplicaSchema(in_geodatabase, in_source)
NameExplanationData Type
in_geodatabase

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

Workspace; GeoDataServer
in_source

The file that contains the replica schema differences that will be imported.

File

Derived Output

NameExplanationData Type
out_geodatabase

The updated replica geodatabase.

Workspace

Code sample

ImportReplicaSchema example (Python window)

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


import arcpy
arcpy.env.workspace = "C:/Data"
arcpy.management.ImportReplicaSchema("Countries.gdb", "schemaDifferences.xml")
ImportReplicaSchema example 2 (stand-alone script)

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

# Description: Import a schema changes file into a replica geodatabase

# Import system modules
import arcpy

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

# Set local variables
replica_geodatabase = "Countries.gdb"
schema_file = "schemaDifferences.xml"

# Run ImportReplicaSchema
arcpy.management.ImportReplicaSchema(replica_geodatabase, schema_file)

Related topics