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

Create Replica From Server

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

Summary

Creates a replica using a specified list of feature classes, layers, feature datasets, and/or tables from a remote geodatabase using a geodata service published on ArcGIS for Server.

Usage

  • The source must be a geodata service representing a remote ArcSDE geodatabase. The destination may be either a local or a remote geodatabase.

  • The data that you wish to replicate must be versioned, but not with the option to move edits to base. The database user who is connected 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 and have a high-precision spatial reference.

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

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

  • 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 default for feature classes is to replicate all features. The default filter for tables is Schema Only; only the schema for the table will be replicated. If you set the Extent environment or specify replica geometry features, it will be applied as a spatial filter where only features intersecting the extent will be replicated. Tables will also include rows that are related to rows which are part of the replica.

  • Replica Geometry Features 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 are set, only data intersecting the Replica Geometry Features will be replicated.
    • If only the Extent environment setting is set, only data intersecting the extent will be replicated.
    • If both the Replica Geometry Features and the Extent environment are set, the Replica Geometry Features will be used.
    • If neither the Replica Geometry Features nor the Extent environment is specified, the full extent of the data is 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 are 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

CreateReplicaFromServer_management (in_geodataservice, datasets, 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_geodataservice

The geodata service representing the geodatabase from which the replica will be created. The geodatabase referenced by the geodata service must be an ArcSDE geodatabase.

GeoDataServer
datasets
dataset_name

The list of the feature datasets, stand-alone feature classes, tables, and stand-alone attributed relationship classes from the geodata service to replicate.

String
in_type

The kind of replica to create.

  • TWO_WAY_REPLICA — Changes can be sent between child and parent replicas in both directions.
  • ONE_WAY_REPLICA —Changes are 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 are 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 ArcSDE, file, or personal geodatabase. For two-way replicas the child geodatabase must be ArcSDE. For one-way and check-out replicas the geodatabase can be personal, file, or ArcSDE. 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)

The type of access you want:

  • FULL —Supports complex types (topologies and geometric networks) and requires the data to be versioned.
  • 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)

Used by replication to determine 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
  • PARENT_DATA_SENDER
String
expand_feature_classes_and_tables
(Optional)

Specifies whether you will include expanded feature classes and tables, such as those found in geometric networks, topologies, or relationship classes.

  • USE_DEFAULTS —Adds the expanded feature classes and tables related to the feature classes and tables in the replica. The default for feature classes is to replicate all features; the default for tables is to replicate the schema only. If a spatial filter has been defined it will be applied to feature classes.
  • ADD_WITH_SCHEMA_ONLY —Adds only the schema for the expanded feature classes and tables.
  • ALL_ROWS —Adds all rows for expanded feature classes and tables.
  • DO_NOT_ADD —Doesn't add expanded feature classes and tables.
String
reuse_schema
(Optional)

Indicates whether to reuse a geodatabase that contains the schema of the data you want to replicate. This reduces the amount of time required to replicate the data. This option is only available for check-out replicas.

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

Specifies whether to replicate rows related to rows already in the replica. 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 —Do not replicate related rows.
  • GET_RELATED —Replicate related data. This is the default.
String
geometry_features
(Optional)

The features used to define the area to replicate.

Feature Layer
archiving

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.

  • ARCHIVING —Uses archiving to track changes.
  • DO_NOT_USE_ARCHIVING —Does not use archiving to track changes. This is the default.
Boolean

Code sample

CreateReplicaFromServer example 1 (Python window)
import arcpy
from arcpy import env
env.workspace = "C:/Data/MySDEdata.sde"
arcpy.CreateReplicaFromServer_management("GIS Servers\jerome\RoadMap.GeoDataServer", "Roads", "TWO_WAY_REPLICA", env.workspace, "MajorRoads_replica", "FULL", "CHILD_DATA_SENDER", "USE_DEFAULTS", "DO_NOT_REUSE", "GET_RELATED")
CreateReplicaFromServer example 2 (stand-alone Python script)
# Name: CreateReplicaFromServer_Example2.py
# Description: Creates a two-way replica from a geodata service


# Import system modules
import arcpy
from arcpy import env

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

# Set local variables
gisServer = "GIS Servers/jerome/RoadMap.GeodataServer"
in_datasets = "Roads; Streets"
replica_type = "TWO_WAY_REPLICA"
out_workspace = env.workspace
replica_name = "MajorRoads_replica"
access_type = "FULL"
initial_sender = "CHILD_DATA_SENDER"
expand = "USE_DEFAULTS"
reUse = "DO_NOT_REUSE"
related = "GET_RELATED"
replica_geometry = "LA_County"
archiving = "DO_NOT_USE_ARCHIVING"

# Execute CreateReplicaFromServer
arcpy.CreateReplicaFromServer_management(gisServer, in_datasets, replica_type, out_workspace, replica_name, access_type, initial_sender, expand, reUse, related, replica_geometry, archiving)

Environments

  • Current Workspace
  • Output CONFIG Keyword
  • Extent
  • 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
  • Preparing data for replication
  • Replication types
  • Replica creation and versioning
  • A quick tour of replica management

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