Create Replica From Server (Data Management)

License Level:BasicStandardAdvanced

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

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_REPLICAChanges are sent from the parent replica to the child replica only.
  • CHECK_OUTData is replicated, edited, and checked back in one time.
  • ONE_WAY_CHILD_TO_PARENT_REPLICAChanges 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:

  • FULLSupports complex types (topologies and geometric networks) and requires the data to be versioned.
  • SIMPLEThe 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_DEFAULTSAdds 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_ONLYAdds only the schema for the expanded feature classes and tables.
  • ALL_ROWSAdds all rows for expanded feature classes and tables.
  • DO_NOT_ADDDoesn'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_REUSEDo not reuse schema. This is the default.
  • REUSEReuse 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_RELATEDDo not replicate related rows.
  • GET_RELATEDReplicate 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.

  • ARCHIVINGUses archiving to track changes.
  • DO_NOT_USE_ARCHIVINGDoes 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

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
5/7/2015