Select to view content in your preferred language

Cannot create Replica using RegisterReplicaForServer option with one-way feature service-to-feature with sync enabled

99
1
Jump to solution
Friday
midmike
New Contributor III

Hello @Diana_Muresan  I saw the blog One-way feature service-to-feature service sync and do the following workflow. However, The replica ID from the source service not same as replica ID with target service.

I have published source and target service however, I don't see the property of  "supportRegisterReplicaForServer : true" as you show in the blog, In my service show the SyncCapability shown below

midmike_0-1720772972329.png

And I try to create Replica for both source and target service using registerReplicaForServer, however the Replica ID of source and target does not MATCH

The config of create replica for my source service as below

 

midmike_1-1720773245666.png

The Replica with source ID is D97CA10C-E80C-4931-8627-51E27F6D7EE4

The config of create replica for target source service as below. which I put the Replica Source ID to target also 

midmike_2-1720773327407.png

Ensure My config feature service with source and target show as below 

  • Same Global ID with using copy-paste function
  • Feature service layer ID of source and target is matching
  • Both source and target has sync enabled
  • Both source and target service using PostgreSQL with enable enterprise geodatabase
  • Both source and target of Version creation of Sync is "None"
  • I investigate with ArcGIS Enterprise 11.3 and ArcGIS Pro 3.3

So the questions is

  1. How can I set property of "supportRegisterReplicaForServer : true is source and target feature service
  2. How can I set the Replica ID with source and target service to match

Thank you, 

Mike

1 Solution

Accepted Solutions
Diana_Muresan
Esri Contributor

Hi @midmike,

 

The first thing I want to confirm is that the source and the target feature classes are stored in two different enterprise geodatabases. This is a necessary requirement for this workflow. 

 

From the screenshots you provided there seem to be a couple issues with the functions syntax, that might cause the replica pair to be created.

  • For the source feature service, in the replicaOptions syntax, you need to specify the ServerGen and ServerSibGen numbers. Here is a syntax example: {"registerReplicaForServer":{"refReplicaServerGen": 1690749452000, "refReplicaServerSibGen":  1690749452000}} 

You can use any online tool to generate the UNIX epoch time in milliseconds, then add the value for the ServerGen parameter.

 

  • For the target feature service, you correctly referenced the source replica ID, however there is an "=" sign that makes the replicaOtions syntax incorrect. Here is a syntax example: {"registerReplicaForServer":{"refReplicaId": "YOUR SOURCE REPLICA ID", "refReplicaServerGen": 1690749452000, "refReplicaServerSibGen":  1690749452000}} 

 

A clear indicator that the operation was successful is that in the response, you will get a URL to a json file that stores all the replica information. Here is an example of a correct response: "https://.....esri.com/server/rest/directories/arcgisoutput/MapServer/_ags_fs24fff2cba933432d96a9bcdcdac16860.json"

 

Additional resources:

I would recommend to check out the ArcGIS Enterprise: Feature Service Sync Workflows technical session. If you jump to minute 42, it takes you directly to a step-by-step demo on creating replicas using the Rest API. This will bring more clarity into the syntax format you need use. 

Here is the Create Replica and Synchronize Replica ArcGIS REST APIs documentation. 

In the One-way feature service-to-feature service sync blog I added a copy of a sample script that goes through the entire workflow automatically. Add into the script your feature services then run the script. The script creates a replica pair then synchronizes any changes. This is a much faster and efficient way to do this workflow. 

 

Best, 

Diana

View solution in original post

1 Reply
Diana_Muresan
Esri Contributor

Hi @midmike,

 

The first thing I want to confirm is that the source and the target feature classes are stored in two different enterprise geodatabases. This is a necessary requirement for this workflow. 

 

From the screenshots you provided there seem to be a couple issues with the functions syntax, that might cause the replica pair to be created.

  • For the source feature service, in the replicaOptions syntax, you need to specify the ServerGen and ServerSibGen numbers. Here is a syntax example: {"registerReplicaForServer":{"refReplicaServerGen": 1690749452000, "refReplicaServerSibGen":  1690749452000}} 

You can use any online tool to generate the UNIX epoch time in milliseconds, then add the value for the ServerGen parameter.

 

  • For the target feature service, you correctly referenced the source replica ID, however there is an "=" sign that makes the replicaOtions syntax incorrect. Here is a syntax example: {"registerReplicaForServer":{"refReplicaId": "YOUR SOURCE REPLICA ID", "refReplicaServerGen": 1690749452000, "refReplicaServerSibGen":  1690749452000}} 

 

A clear indicator that the operation was successful is that in the response, you will get a URL to a json file that stores all the replica information. Here is an example of a correct response: "https://.....esri.com/server/rest/directories/arcgisoutput/MapServer/_ags_fs24fff2cba933432d96a9bcdcdac16860.json"

 

Additional resources:

I would recommend to check out the ArcGIS Enterprise: Feature Service Sync Workflows technical session. If you jump to minute 42, it takes you directly to a step-by-step demo on creating replicas using the Rest API. This will bring more clarity into the syntax format you need use. 

Here is the Create Replica and Synchronize Replica ArcGIS REST APIs documentation. 

In the One-way feature service-to-feature service sync blog I added a copy of a sample script that goes through the entire workflow automatically. Add into the script your feature services then run the script. The script creates a replica pair then synchronizes any changes. This is a much faster and efficient way to do this workflow. 

 

Best, 

Diana