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

Creates a replica to a geodatabase from a specified list of feature classes, layers, datasets, and tables in an enterprise geodatabase.

Usage

  • All datasets must be from the same enterprise geodatabase.

  • The data that will be replicated must be versioned but not with the option to move edits to base.

  • The connected database user must also have write permissions to the data.

  • For two-way and both types of one-way replicas, all datasets must have a GlobalID column.

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

  • For two-way and one-way child-to-parent replicas, the child geodatabase must be an enterprise 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.

  • The definition query and selection properties set on a layer or table determine which data will be replicated.

  • For tables, the default filter is Schema Only; only the schema for the table will be replicated. To apply a filter to a table, first create a table view with the desired filters. Then use this as input to the Create Replica tool. See Make Table View for more information. For more information about filters and replication, see Preparing data for replication.

  • The Replica Geometry Features parameter can be used to define the replica geometry. You can also use the Extent environment setting to define the replica geometry.

    • If only the Replica Geometry Features parameter is set, only data intersecting the replica geometry features will be replicated.
    • If only the Extent environment is set, only data intersecting the extent will be replicated.
    • If both the Replica Geometry Features parameter and the Extent environment are set, the Replica Geometry Features parameter will be used.
    • If neither the Replica Geometry Features parameter nor the Extent environment is specified, the full extent of the data will be used.

  • The replica geometry features can be points, lines, or polygons.

  • A feature layer used for the replica geometry features can contain one or more features. If there is more than one, the geometries are merged, and only data that intersects the merged geometries will be replicated.

  • If filters (such as spatial, selection, or definition query) have been defined on the replica geometry features, only features that satisfy these filters will be used to define the replica geometry. See Preparing data for replication for more information.

  • The Re-use Schema parameter options are only available for checkout replicas.

Syntax

CreateReplica(in_data, in_type, out_geodatabase, out_name, {access_type}, {initial_data_sender}, {expand_feature_classes_and_tables}, {reuse_schema}, {get_related_data}, {geometry_features}, archiving)
ParameterExplanationData Type
in_data
[in_data,...]

The data to be replicated. This list consists of layers and tables referencing versioned, editable data from an enterprise geodatabase.

Layer; Table View; Dataset
in_type

Specifies the type of replica to create.

  • TWO_WAY_REPLICA — Changes can be sent between child and parent replicas in both directions.
  • ONE_WAY_REPLICA —Changes can be sent from the parent replica to the child replica only.
  • CHECK_OUT —Data is replicated, edited, and checked back in one time.
  • ONE_WAY_CHILD_TO_PARENT_REPLICA —Changes can be sent from the child replica to the parent replica only.
String
out_geodatabase

The local geodatabase or geodata service that will host the child replica. Geodata services are used to represent remote geodatabases. The geodatabase can be an enterprise, file, or personal geodatabase. For two-way replicas, the child geodatabase must be an enterprise geodatabase. For one-way and check-out replicas, the geodatabase can be a personal, file, or enterprise geodatabase. Personal or file geodatabases must already exist before running this tool.

Workspace; GeoDataServer
out_name

The name that identifies the replica.

String
access_type
(Optional)

Specifies the type of replica access.

  • FULL —Complex types (topologies and geometric networks) are supported and the data must be versioned. This is the default.
  • SIMPLE —The data on the child is not versioned and must be simple. This allows the replica to be interoperable. Nonsimple features in the parent (for example, features in geometric networks and topologies) are converted to simple features (for example, point, line, and polygon feature classes).
String
initial_data_sender
(Optional)

Specifies which replica can send changes when in disconnected mode. If you are working in a connected mode, this parameter is inconsequential. This ensures that the relative replica doesn't send updates until the changes are first received from the initial data sender.

  • CHILD_DATA_SENDER —The child replica is the initial data sender. This is the default.
  • PARENT_DATA_SENDER —The parent replica is the initial data sender.
String
expand_feature_classes_and_tables
(Optional)

Specifies whether expanded feature classes and tables—such as those in geometric networks, topologies, or relationship classes—will be added.

  • USE_DEFAULTS —The expanded feature classes and tables related to the feature classes and tables in the replica will be added. The default for feature classes is to replicate all features intersecting the spatial filter. If no spatial filter has been provided, all features are included. The default for tables is to replicate the schema only. This is the default.
  • ADD_WITH_SCHEMA_ONLY —Only the schema for the expanded feature classes and tables will be added.
  • ALL_ROWS —All rows for expanded feature classes and tables will be added.
  • DO_NOT_ADD —No expanded feature classes and tables will be added.
String
reuse_schema
(Optional)

Specifies whether a geodatabase that contains the schema of the data to be replicate will be reused. This reduces the amount of time required to replicate the data. This option is only available for check-out replicas.

  • DO_NOT_REUSE —Schema will not be reused. This is the default.
  • REUSE —Schema will be used.
String
get_related_data
(Optional)

Specifies whether rows related to rows already in the replica will be replicated. For example, consider a feature (f1) inside the replication filter and a related feature (f2) from another class outside the filter. Feature f2 is included in the replica if you choose to get related data.

  • DO_NOT_GET_RELATED —Related data will not be replicated.
  • GET_RELATED —Related data will be replicated. This is the default.
String
geometry_features
(Optional)

The features used to define the area to replicate.

Feature Layer
archiving

Specifies whether the archive class will be used to track changes instead of the versioning delta tables. This is only available for one-way replicas.

  • ARCHIVING —Archiving will be used to track changes.
  • DO_NOT_USE_ARCHIVING —Archiving will not be used to track changes. This is the default.
Boolean

Derived Output

NameExplanationData Type
out_child_geodatabase

The output child geodatabase.

Workspace
output_replica_name

The name of the output replica.

String

Code sample

CreateReplica example 1 (Python window)

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

import arcpy
arcpy.env.workspace = "C:/Data/MyData.sde"

arcpy.CreateReplica_management("roads", "ONE_WAY_REPLICA", 
                               "C:\Data\MyTargetGDB.gdb", "MyReplica", "FULL", 
                               "PARENT_DATA_SENDER", "USE_DEFAULTS", 
                               "DO_NOT_REUSE", "TRUE")
CreateReplica example 2 (stand-alone script)

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

# Name: CreateReplica_Example2.py
# Description: Create a one-way replica of a Feature Dataset to a file geodatabase. 

# Import system modules
import arcpy

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

# Set local variables
in_data = "Parks" # a feature dataset
replica_type = "ONE_WAY_REPLICA"
output_workspace = "C:\Data\MyTargetGDB.gdb"
replica_name = "MyReplica"
access_type = "FULL"
initial_sender = "PARENT_DATA_SENDER"
expand = "USE_DEFAULTS"
reuse_schema = "DO_NOT_REUSE"
get_related = "GET_RELATED"
replica_geometry = "LA_County"
archiving = "DO_NOT_USE_ARCHIVING"

# Execute CreateReplica
arcpy.CreateReplica_management(in_data, replica_type, output_workspace, 
                               replica_name, access_type, initial_sender, 
                               expand, reuse_schema, get_related, 
                               replica_geometry, archiving)

Environments

  • Current Workspace
  • Output CONFIG Keyword
  • Extent
  • Scratch Workspace

Licensing information

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

Related topics

  • An overview of the Distributed Geodatabase toolset
  • Working with geodatabase replicas
  • Preparing data for replication
  • Replica creation and versioning
  • Replication types

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

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

About Esri

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