ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Compare Replica Schema

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Generates an XML 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. Three tools are provided for this purpose: Compare Replica Schema, Import Replica Schema, and Export Replica Schema:

    • Use Compare Replica Schema (this tool) to generate an XML file containing the schema changes.
    • Import these changes with the Import Replica Schema tool.
    • If you're working in a disconnected environment, you first need to run the Export Replica Schema tool to export the schema with the changes to an XML file. This file can then be transported on media, such as CDs or DVDs, for input into the Compare Replica Schematool.

  • The output replica schema changes file must be XML.

Syntax

CompareReplicaSchema_management (in_geodatabase, in_source_file, output_replica_schema_changes_file)
ParameterExplanationData Type
in_geodatabase

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

Workspace; GeoDataServer
in_source_file

Specifies the file that contains the relative replica schema to use for the comparison.

File
output_replica_schema_changes_file

Specifies the file to 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
from arcpy import env
env.workspace = "C:/Data"
arcpy.CompareReplicaSchema_management("MySDEdata.sde", "RelativeReplicaSchema.xml", "SchemaComparison.xml")
CompareReplicaSchema example 2 (stand-alone Python script)

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

# Name CompareReplicaSchema_Example2.py
# Description: Compares a replica schema (in an SDE workspace) to its relative replicas schema (in an XML file).  
# The results of the comparison are created in an XML file
# The relative replicas XML schema file was created using the ExportReplicaSchema tool.


# Import system modules
import arcpy
from arcpy import env

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

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

# Execute CompareReplicaSchema
arcpy.CompareReplicaSchema_management(in_geodatabase, in_source_file, output_schema_changes)

Environments

  • Current Workspace
  • Scratch Workspace

Licensing information

  • ArcGIS for Desktop Basic: No
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Distributed Geodatabase toolset
  • Working with geodatabase replicas
  • Synchronizing connected replicas
  • Schema changes

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal