Create Replica (Production Mapping)


A replica is a copy of an enterprise geodatabase dataset. You can work independently with replicas and synchronize changes with the data's original geodatabase.

This tool creates a replica in a personal, file, or enterprise geodatabase from a specified list of feature classes, layers, datasets, or tables. Optionally, you can use a filter geometry from another feature layer to replicate features within an area of interest.



CreateReplica_production (in_datasets, in_replicatype, in_childworkspace, in_replicaname, {in_reuse_schema}, {in_usefilter}, {in_filtertype}, {in_features}, {in_access_type}, {in_use_archiving})
ParameterExplanationData Type

The data to replicate. This can consist of individual feature classes and tables or entire datasets.

Feature Layer; Table View; Dataset

The type of replica to create:

  • CHECKOUTCreates a replica in which the changes can be checked back into the parent geodatabase from the child. This is the default.
  • ONE_WAYCreates a replica in which changes cannot be transferred from the child to the parent, but changes can be continually synchronized from the parent to the child.
  • TWO_WAYCreates a replica in which changes can be transferred from the parent to the child and vice versa.

The path to and name of the workspace that is going to contain the replicated data.

Workspace; GeoDataServer

The name of the replica you are going to create.


Indicates whether to reuse the schema of existing data in in_childworkspace. This option can reduce the time required to replicate data by not recreating existing schemas in in_childworkspace. in_reuse_schema is most efficient when used to replicate data into empty schemas in in_childworkspace. This option is only available for check-out replicas.

  • DO_NOT_REUSEDo not reuse schema. This is the default.
  • REUSEReuse schema.

Replicates features that either intersect or are contained by features in the in_features feature layer.

  • TRUEApplies the filter set in in_filtertype. You must set in_filtertype and in_features.
  • FALSEDoes not apply the spatial filter. This is the default.

Specifies the spatial relationship between in_datasets and in_features.

  • INTERSECTSExtract features from in_datasets that intersect features in in_features. This is the default.
  • CONTAINSExtract features from in_datasets that are contained by the selected feature in the in_features.

Feature layer with one selected feature.


Indicates the feature information model type to replicate. Model type specifies either simple or complex features.

  • FULLReplicates complex types (topologies and geometric networks) to complex types in in_childworkspace. This option requires versioned data. This is the default.
  • SIMPLEReplicates all data, including complex types, to simple types in in_childworkspace. The data on the child is not versioned if replicated to an ArcSDE geodatabase. This allows the replica to be interoperable with simple feature viewers and editors that are not based on the ArcGIS engine.

Specifies whether to use the archive class to track changes instead of using the versioning delta tables. This is only available for one-way replicas. in_replicatype must be created from the DEFAULT version.

  • ARCHIVINGUses archiving to track changes.
  • NO_ARCHIVINGDoes not use archiving to track changes. This is the default.

Code Sample

CreateReplica example 1 (Stand–alone Python script)

This script demonstrates the use of the Production Mapping CreateReplica tool. The script creates a replica of Production Mapping SoCal sample data stored in ArcSDE. The script selects a single feature in the CoastA feature class. The script creates a replica of all TreesA features that intersect the selected feature in CoastA. Replicated features are written to a file geodatabase.

# Name:
# Description: Creates a checkout replica from the SoCal sample data
# Author: ESRI
# Date: March 2010

import arcpy

# check out a foundation license

# import the production mapping toolbox - you may have to change this path
arcpy.ImportToolbox(r'C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Production Mapping Tools.tbx')

# set our workspace to an sde connection file
arcpy.env.workspace = "c:/data/SoCal.sde"

# fully qualified name to an ArcSDE feature class (dataset/feature class)
coastpath = "socal.GIS.SoCal/socal.GIS.CoastA"

# make a feature layer from islands in the CoastA feature class in the
# prod mapping sample data 
if arcpy.Exists("Coast") == False:

# select an island - verify that objectid 84 is an island in your data

checkoutDb = "c:/data/SoCalIslandTrees.gdb"

# make a new geodatabase
if arcpy.Exists(checkoutDb) == False:

# another fully qualified ArcSDE name (dataset/feature class)

# check out some data into the new file gdb

# check the extension in

CreateReplica example 2 (Python window)

This ArcGIS Python window example demonstrates how to use the CreateReplica tool with the ONE_WAY replica type. The script replicates production mapping SC_Index sample data from an Oracle instance to an SQL Server Instance.

# import the production mapping toolbox - you may have to change this path
arcpy.ImportToolbox(r'C:\Program Files\ArcGIS\Desktop10.0\ArcToolbox\Toolboxes\Production Mapping Tools.tbx')


Related Topics

Licensing Information

ArcView: No
ArcEditor: Requires Production Mapping
ArcInfo: Requires Production Mapping