ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS 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
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Create Replica

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

Summary

A replica is a copy of an enterprise geodatabase dataset. You can work independently with replicas and synchronize changes with the data's original enterprise 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.

Usage

  • All datasets must be from the same enterprise geodatabase.

  • This tool is similar to the Create Replica tool in the Data Management toolbox. This tool allows you to use a selected feature in another feature layer as an area of interest for replicated features. Any features from Replica Datasets with the USE_FILTERS option that intersect or are contained by the selected feature in Filter Feature Layer will be replicated to the Child Workspace.

  • Data replicated with the ONE_WAY and TWO_WAY options must have a populated Global ID type field. Use the Add Global IDs tool in the Management toolbox to create and populate a global ID field in your data.

  • For checkout and one-way replicas, the child replica geodatabase can be an enterprise geodatabase, personal, or file geodatabase.

  • For one-way and two-way child–to–parent replicas, the child geodatabase must be a file geodatabase.

  • To use archiving for one-way replicas, the parent workspace must be connected to the default version. For one-way child-to-parent replicas, the child workspace must be connected to the default version.

  • Use selection sets and layer definition queries to limit or specify features to replicate. To do this in ArcCatalog, use the Make Feature Layer tool or create layer files for Replica Datasets.

  • Related data is replicated by default. To avoid replicating related data, you must specify each relationship class that defines the related objects you want to exclude using the Exclude Relationship Classes parameter.

  • Related data is replicated in a forward direction, from origin to destination.

  • If using Register Using Existing Data, you must make sure to add Global IDs to the data before you copy it to the other geodatabase. If you use functionality within ArcGIS to copy the data, make sure to use either copy and paste, data extraction, or XML workspace export and import.

  • You must be connected as the owner of the data on the target geodatabase when creating the replica.

  • Whatever filters are applied during the replica creation process also are applied to the data in the relative geodatabase.

  • The Register Using Existing Data option also works in disconnected environments.

Syntax

arcpy.production.CreateReplica(in_datasets, in_replicatype, in_childworkspace, in_replicaname, {in_reuse_schema}, {in_usefilter}, {in_filtertype}, {in_features}, {in_access_type}, {in_use_archiving}, {in_exclude_rel_classes}, {in_register_existing_only}, {in_ignore_where_clause_for_deletes}, {in_ignore_updates_outside_filter})
ParameterExplanationData Type
in_datasets

Value table of rows that contain a dataset to replicate and a filter option for that dataset. Specifying a filter option allows you to control how rows are replicated per dataset. Filter options include the following:

  • USE_FILTERS —If in_usefilter is set to FILTER_BY_GEOMETRY, the tool replicates features that either intersect or are contained by in_features.
  • SCHEMA_ONLY —Replicate the schema of the dataset to in_childworkspace.
  • ALL_ROWS —Replicate all rows of the dataset to in_childworkspace.
Value Table
in_replicatype

The type of replica to create:

  • CHECKOUT —Create a replica in which the changes can be checked back into the parent geodatabase from the child. This is the default.
  • ONE_WAY —Create 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_WAY —Create a replica in which changes can be transferred from the parent to the child and vice versa.
  • ONE_WAY_CHILD_TO_PARENT_REPLICA —Changes are sent from the child replica to the parent replica only.
String
in_childworkspace

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

File; GeoDataServer; Workspace
in_replicaname

The name of the replica you create.

String
in_reuse_schema
(Optional)

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

  • DO_NOT_REUSE —Do not reuse schema. This is the default.
  • REUSE —Reuse schema.
String
in_usefilter
(Optional)

Replicates features that either intersect or are contained by in_features. Only applied to in_datasets that have the USE_FILTERS option.

  • FILTER_BY_GEOMETRY —Apply the filter set in the in_filtertype. You must set in_filtertype and in_features.
  • NO_FILTER_BY_GEOMETRY —Do not apply the spatial filter. This is the default.
Boolean
in_filtertype
(Optional)

Specifies the spatial relationship between in_datasets and in_features.

  • INTERSECTS —Extract features from in_datasets that intersect features in the in_features. This is the default.
  • CONTAINS —Extract features from in_datasets that are contained by the selected feature in the in_features.
  • HAVE_THEIR_CENTER_IN —Extract features from in_datasets that have their centroid in the selected feature from in_features.

String
in_features
(Optional)

Feature layer with one selected feature.

Layer
in_access_type
(Optional)

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

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

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. The in_replicatype must be created from the DEFAULT version.

  • ARCHIVING —Use archiving to track changes.
  • NO_ARCHIVING —Do not use archiving to track changes. This is the default.
Boolean
in_exclude_rel_classes
[in_exclude_rel_classes,...]
(Optional)

The list of relationship classes whose relationships you want to exclude from replication. The relationship classes will still be included if both datasets that participate are present, but the related objects are not replicated.

Relationship Class
in_register_existing_only
(Optional)

Allows the creation of replica versions needed to synchronize changes between geodatabases using existing data. This will disable the process of copying data.

  • REGISTER_EXISTING_DATA_ONLY —Use existing data to create the replica.
  • DO_NOT_REGISTER_EXISTING_DATA_ONLY —Copy the data to replicate to the child. This is the default.
Boolean
in_ignore_where_clause_for_deletes
(Optional)
  • IGNORE_WHERE_CLAUSE_FOR_DELETES — Deletes are sent for a layer regardless if the where clause on the layer is satisfied.
  • NO_IGNORE_WHERE_CLAUSE_FOR_DELETES — Deletes are only sent where the where clause on the layer is satisfied. This is the default.
Boolean
in_ignore_updates_outside_filter
(Optional)
  • IGNORE_UPDATES_OUTSIDE_FILTER — Only updates that have the attribute forSync set to true will be sent.
  • NO_IGNORE_UPDATES_OUTSIDE_FILTER — All updates will be sent. This is the default.
Boolean

Code sample

CreateReplica example (stand–alone script)

The following stand-alone script demonstrates how to use the CreateReplica tool.

# Name: CreateReplica.py
# Description: Creates a checkout replica
# Requirements: ArcGIS Production Mapping

import arcpy

# check out a foundation license
arcpy.CheckOutExtension("Foundation")

# set gp environment
workspace="c:/data"
arcpy.env.workspace=workspace
arcpy.addOutputsToMap = True

# variables for tool parameters
filterFeatureClass = "Austin.gdb/AOI"
filterFeature = "AOI Layer"
filterWhere="MSNAME='Austin East'"
selectType="NEW_SELECTION"
checkoutDb = "checkoutDb.gdb"
# note: change the fully qualified name to your database.owner
inDatasets="austin.sde/database.owner.TopographicMap/database.owner.ElevationP USE_FILTERS"
replicaType="CHECKOUT"
replicaName="austin_elevations_contours"
reuseSchema="DO_NOT_REUSE"
useFilter="FILTER_BY_GEOMETRY"
filterType="INTERSECTS"
accessType="FULL"
useArchiving="NO_ARCHIVING"
excludeRelClass="austin.sde/database.owner.TopographicMap/database.owner.RelClass"
useExisting="DO_NOT_REGISTER_EXISTING_DATA_ONLY"

# Create an in_features feature layer
if arcpy.Exists(filterFeature) == False:
    arcpy.MakeFeatureLayer_management(filterFeatureClass,filterFeature)

# select one feature from the feature layer
arcpy.SelectLayerByAttribute_management(filterFeature,selectType,filterWhere)

# make a new geodatabase for the replica gdb
if arcpy.Exists(checkoutDb) == False:
    arcpy.CreateFileGDB_management(workspace,checkoutDb)

# check out some data into the new file gdb
arcpy.CreateReplica_production(inDatasets,replicaType,checkoutDb,replicaName,reuseSchema,useFilter,filterType,filterFeature,accessType,useArchiving,excludeRelClass,useExisting)
print arcpy.GetMessages()

Environments

  • Current Workspace
  • Extent
  • Scratch Workspace

Licensing information

  • Basic: No
  • Standard: Requires Production Mapping
  • Advanced: Requires Production Mapping

Related topics

  • An overview of the Distributed Geodatabase toolset
  • Understanding distributed data
  • Replicas and geodatabases
  • Feature information models for replicas
  • Extract Data

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal