ArcGIS Blog

Data Management

ArcGIS Pro

Manage replicas in ArcGIS

By Gary MacDougall and Diana Muresan

Replication is a widely used method for distributing data, whether it’s from a regional office to local offices through geodatabase replication or for performing field edits while offline using feature service replicas. In both scenarios, managing the replicas associated with your geodatabase data is essential. This blog provides tips on managing replicas using the Manage Replicas tab in ArcGIS Pro, a Python script to list all replicas in a geodatabase, and feature service REST API commands for situations which you don’t have access to the underlying geodatabase.

Quick review

Distribute data with geodatabase replication
Distribute data with geodatabase replication

Geodatabase replication is a data distribution method in which data is distributed across two or more geodatabases creating a replica of part of a dataset or an entire dataset. There are three types of geodatabase replication: checkout/check-in, one-way, and two-way. For example, you can use geodatabase replication to distribute your centralized data to different subdivisions based on different projects.

Note: To learn more about this capability, see the Data distribution workflows tutorial series, which describes each replication type using a real-world example.

Take data offline with the feature service sync
Take data offline with the feature service sync

Taking a map offline with feature service sync, allows you to take feature layers offline and stored in a local copy of the data. This allows you to make edits and complete your work without being connected to the network. Once network availability is restored, you can synchronize your local edits. This workflow is particularly useful for field data collection using a mobile device. During this process a replica is created and maintained by the feature service.

Note: To learn more about this capability, see the Take branch versioned data offline with feature service sync capability and Take nonversioned data offline blog, which describes this workflow using a real-world example.

Now, let’s go over some of the ways to manage geodatabase and feature service replicas.

The Manage Replicas pane

In ArcGIS Pro you can use the Manage Replicas tab. The pane can be accessed from the geodatabase level, where you see all the replicas associated with that geodatabase or at the feature class level, which filters the replicas to be displayed only for that specific feature class. This is even more beneficial to identify if a feature class or table is part of any replicas.

The Manage Replicas tab
The Manage Replicas tab

The Manage Replicas pane displays the geodatabase and the feature services replicas in two categories.

The Manage Replicas pane
The Manage Replicas pane

In the Manage Replicas pane you can do the following:

  • Filter replicas using the search bar based on the feature name, replica owner, replica name, ID, and so on. You can also search based on the feature service name to display all the replicas associated with a particular feature service.
The Filter Replicas option
The Filter Replicas option
  • View replica properties, which allows you to refresh the replica, and unregister, or check the replica details.
The Replica Properties option
The Replica Properties option
  • Use the Add replica to map option to add the feature classes of that replica to the map.
The Add Replica to Map option
The Add Replica to Map option
  • Validate the schema option to check for any schema changes between the replica and the source datasets.
The Validate Schema option
The Validate Schema option
  • Unregister a replica

This is especially helpful with unregistering a replica if it is no longer needed, or if the associated feature service has been deleted and the replica is now orphaned.

The Unregister Replica option
The Unregister Replica option

Replicas report

The Manage Replicas tab allows you to manually interact and manage the replicas from ArcGIS Pro using a database connection. You can also automatically list all the replicas in an enterprise geodatabase, using a Python sample script.

The sample script uses the ListReplicas function to list all the replicas in a geodatabase by specifying the path to the database connection file as the argument.

The Generate replicas report sample script
The Generate replicas report sample script

The script iterates through the replicas and prints the replica details in the Output console. The response contains the replica details, such as the replica ID, the sync direction, and the service name for feature services replicas. This is similar to what you would find in the Manage Replicas pane.

The script result
The script result

To make it easier to read, copy the response from the Output console into an empty text editor (for example, Notepad), and save the file as a .csv file.

Once you open the .csv file, you can view all replicas details and manage the replicas based on the details listed.

Replicas listed in a .csv file
Replicas listed in a .csv file

For example, you can find out if a replica has not been synchronized for a long period of time based on the lastSyncDate, lastSend or lastReceive dates. From this you may determine that the replica should be removed as is not in use any longer. To remove the replica, you can copy the replica ID from the report, and use it with the Unregister Replica geoprocessing tool in ArcGIS Pro. The Unregister Replica geoprocessing tool is supported for both geodatabase replicas and replicas generated by the feature service.

The Unregister Replica geoprocessing tool
The Unregister Replica geoprocessing tool

Feature service REST API

If you want to manage feature service replicas but don’t have access to the geodatabase connection, you can use the feature service REST endpoint. This includes a replicas resource which has details about each replica. There are also operations provided in REST to perform actions like unregistering a replica.

Feature service REST API
Feature service REST API

Note that the replicas resource only lists replicas that were created on the service and are accessible by the logged in user.  Non-admin users will have access to replicas they created while admin users can access replicas created by anyone on the service.

We hope you find these tips useful to help you better manage your own replicas. To learn more about ways to distribute your data check out the Geodatabase Resources Hub.

Share this article