Starting with ArcGIS Enterprise 11.3, an ArcGIS REST API enhancement has been added to support one-way feature service sync between two feature services that are pointing to data in two enterprise geodatabases.
As more organizations are using their GIS workflows exclusively over web services, there is a need to support functionality similar to geodatabase replication in which you maintain edits between production and publication geodatabases, but using feature services. Feature service-to-feature service sync facilitates a similar workflow and also supports branch versioned data, which is not supported by geodatabase replication.
Distributed collaboration is an option, but the synchronization process is run at the organization level. This may not be a good fit in some cases as it requires two or more organizations and the use of at least one hosted feature service.
Let’s have a look at a high-level workflow
Prepare the data for publishing
The first step is to prepare the data in two enterprise geodatabases. The databases can be on the same instance or different instances.
Source enterprise geodatabase – You start with one enterprise geodatabase which stores the source data. The data in the source geodatabase can have the following registration types:
- Branch versioned
- Non-versioned with archiving enabled
Target enterprise geodatabase – To complete the workflow, data must be pre-copied from the source geodatabase to a second target enterprise geodatabase. When creating a copy of the source data, keep in mind the following considerations:
- Ensure the source datasets have global IDs assigned. This way, the copied data will have the identical global IDs as the source datasets. This is a primary requirement for the feature service sync workflow.
- Use copy and paste functionality or a database backup and restore to move the datasets to the second enterprise geodatabase. This ensures all the geodatabase functionality, including the global IDs will successfully be copied with the data.
The data in the target geodatabase can have the following registration types:
- Branch versioned
- Non-versioned with archiving enabled
- Non-versioned without archiving enabled
Note: Traditional versioning is not a supported registration type with this workflow.
Publish two feature services
Publish two feature services to ArcGIS Enterprise where one is from the source geodatabase and one is from the target geodatabase. The services can either be published by referencing registered data or by copying all data to the hosting server.
Note: If you use one-way feature service-to-feature service sync between two hosted feature services, ensure the services are published to two different Enterprise portals. The feature service pair can be on the same Enterprise portal only if you have one hosted feature service and one referenced feature service or two referenced feature services.
When publishing, ensure the service configuration matches the registration type of choice, for both the source and the target feature services.
To publish branch versioned data, do the following:
- Enable the Version Management capability, to take advantage of the version administrative tasks.
- The feature services must have the sync capability enabled. Check the Enable Sync check box. The version creation sync option can be either of the options: version per downloaded map or none.
Note: In a one-way feature service-to-feature service sync with branch versioned data, the source replica exports changes from the default version only. This is regardless of the Version Creation option selected. The target replica supports both version creation options. If None is selected, edits synchronize directly to the default version. If the Create a version for each downloaded map option is selected, the edits are uploaded into a named branch on the target enterprise geodatabase.
To publish non-versioned archive enabled data, do the following:
- The feature services must have the sync capability enabled. Check the Enable Sync check box. The version creation sync option is not applicable in this case so it can only be None.
Non-versioned data without archiving enabled is also supported but can only be used a registration type for the data in the target enterprise geodatabase. To publish a feature service that has non-versioned data without archiving enabled, the sync option is not set for the feature service. Non-versioned reference feature services do not support the sync capability, but do allow for an upload-only, server targetType replica to be created and synced. Non-versioned reference feature services include the following service level properties to describe what is supported for this workflow.
Finally, ensure both feature services have identical data with matching layer IDs for the layers you wish to participate in the sync workflow.
Create the replicas
Use the Create Replica operation, with the replicaOptions set to registerReplicaForServer. This new property added to ArcGIS Enterprise 11.3 allows you to create a replica of the feature service that references the original data in the source feature services, without copying any data.
From the Create Replica operation response, a replica ID s generated for the source replica.
Create another replica on the target feature service using the RegisterReplicaForServer option. The RegisterReplicaForServer option allows you to set the target replica ID to match the source replica ID.
Both the source and the target replica require identical replica IDs for the replica pair to be successfully created.
Synchronize the changes
In a one-way feature service-to-feature services sync workflow, the sync direction is always set to download edits from the source replica and upload edits to the target replica.
Run the Synchronize Replica operation on the source replica first to export any edits made on the source feature service to a mobile geodatabase delta file.
Once the edits are exported, the delta file is uploaded to the target feature service. The Synchronize Replica operation is the run again, but this time on the target replica. This will upload the edits and apply them to the target feature service.
When the operation is successfully completed, the changes from the source will have been applied to the target feature service.
Automated workflow
As this is an advanced workflow, to eliminate possible errors and streamline the synchronization process, we recommend automating the workflow using a script. For this blog, we have developed a sample script that goes over the above workflow.
You can download the script and follow the full workflow using your own feature services.
We hope you find this enhancement helpful, and you will include the feature service-to-feature service sync into your own workflows. We are continuing to develop the feature service-to-feature service sync workflow, by looking into improving the user experience, allowing bi-directional sync and support for utility network and parcel fabrics data.
In the meantime, we encourage you to continue to post your ideas and questions on the Esri Community page.
To learn more about ways to distribute your data, check out the Geodatabase Resources Hub.
Commenting is not enabled for this article.