Documentation for Versions and Replicas created by Collector?

2461
11
12-07-2017 02:43 PM
AmyRoust
Occasional Contributor III

Is there any documentation out there that explains how replicas and versions are created, synced/reconciled, and deleted by the Collector app? I found this tutorial that explains that a version is created when a user downloads a map for disconnected e.... However, I am looking at my SDE database and I can see that there is both a replica named Ags_Fs and a version named Esri_Anonymous_PublicWorks/Sig. I am looking for a clear picture of the chain of events that collects, stores, and distributes edits among the various branches that Collector creates.

I ask because I'm writing a Python script to automate the synchronization of edits overnight. I have 2-3 desktop editors and 2-4 disconnected editors with iPads. I need to make sure I understand the right order of reconciling so that all edits safely make it back into the DEFAULT version of the parent database.

I can write the Python script, so I'm not looking for coding help.

0 Kudos
11 Replies
BillFox
MVP Frequent Contributor

Hello Amy,

I think the replica option is a manual process that the user can choose a sync button when they are back on the network/wifi/vpn.

The other option should let you configure it so a new version is created based on the user's name that you could then have a windows scheduled task running the python reconcile & post tool set to do the reconcile and post every ten minutes.

-Bill

0 Kudos
AmyRoust
Occasional Contributor III

I did some testing this morning and I think I have it figured out. It would be great if someone from Esri could confirm or correct!

I have an ArcGIS Online map set up with a service that allows users to edit on the DEFAULT version of the parent database. There are no versions or replicas if you edit directly in this map. Introducing Collector seems to produce the following:

  • When I open this map in Collector and edit while connected to WiFi, no versions or replicas are created. I am editing on DEFAULT.
  • If I tap the button to download the map for offline use, the download process does the following:
    • If I were downloading the basemap, it would make a copy of the tiles in my desired work area and put those on my device. However, I have loaded a tile package directly on to the iPad, so I tell it to use that map instead. The only data being downloaded is the sign inventory feature class and tables.
    • Next, it creates a version on the SDE database that holds my sign inventory data. The version is called Esri_Anonymous_PublicWorks/Sig because I have the feature service set up to download per user as opposed to by map. Since we do not have named users in our database, this is the only version that will be created. Any subsequent editors who download the map for disconnected editing will be automatically pointed to this same version.
    • Next, it creates a two-way child replica called Ags_fs off of the Esri_Anonymous_PublicWorks/Sig version. (If another iPad user downloads a map for offline use, then another child replica will be created called Ags_fs1.)
  • When the iPad user comes back to the office and connects to WiFi, s/he taps the synchronize button. This pushes the changes from the child replica to the version.
  • When the iPad user goes to the Manage menu and removes the downloaded features, the child replica is deleted. The version stays active in the database, but the iPad is now pointing back at the parent DEFAULT version because the downloaded replica has been removed. This will result in the odd experience of the user going into the map and being unable to see the edits s/he just made in the field.
  • Someone with ArcGIS Desktop software needs to post and reconcile the version so that edits are moved into DEFAULT. Once this is done, the edits made in the field will be once again visible on both the iPad and in the original ArcGIS Online map.
  • At this point, as long as the Esri_Anonymous_PublicWorks/Sig version has been posted and reconciled and there are no other child replicas pointing at it, I can safely delete it.
0 Kudos
MarkLund
New Contributor III

Hi Amy,

I have been using a similar workflow for a few years now.  I have scripts in place to rec/post all of my Collector versions each night.  We use secured ArcGIS Server services with our apps which allows for editor tracking to be tied to the user's network account.  This also helps because when the map is downloaded the child replica that is created has that users login tied to it instead of the ESRI_Anonymous name.  It looks like domain\username_servicename. 

I very rarely delete any of my Collector versions or mess with any of the child replicas since we run the same webmaps for long term purposes and then don't have to constantly re-download the maps to the ipads.  My script is running a compress after the post/rec too so that helps clean up any loose ends. 

Beacuse we have a number of Collector versions 10+ I created a two-way replica from SDE first and then publish my services off of the child database so that all of my Collector versions stay there.  We have 20+ office editors on SDE so it just works better to keep the field vs the office versions apart.  We also have a sync replica script that runs nightly as well after the post/rec on the Collector versions to send that data to the main SDE.  Overall it looks and sounds kind of messy but really seems to work well and hasn't caused us any issues. 

Mark

AmyRoust
Occasional Contributor III

Thanks, Mark, that is all helpful information. My original script did a post/reconcile on the versions and then deleted them so that I would get a better compress in SDE. Unfortunately, my iPad user hadn't deleted his child replica before that script ran, so we got an error message on the iPad when we tried to sync. (The error message detail was "abort due to constraint violation," which didn't exactly help us figure out the problem.) That's when I discovered the child replica and was confused -- I wrongly assumed that I was only dealing with versions, so I hadn't factored anything else into the design of the script.

Good to know that you haven't deleted your replicas or versions and are having success. I read an Esri workflow that instructed the iPad users to always delete the downloaded map after syncing, so I was beginning to think that it was required.

0 Kudos
BillFox
MVP Frequent Contributor

does your workflow include a weekly compress to state zero?

0 Kudos
by Anonymous User
Not applicable
AmyRoust
Occasional Contributor III

Thanks, Dan -- I found that page this morning and it was indeed helpful.

0 Kudos
DougGreen
Occasional Contributor

Dan,

This is more than I was able to find through searching so it is helpful. However, I landed on this thread searching for a scenario that is not documented. I think others may be asking it in other words but instead, I'll try this approach.

We have users that have their phone fall in the sewer or the stream or get mangled by kids and wiped, etc. This basically deletes the device data without ever letting the replica parent know. How do I find out that a replica version needs deleted and its associated replica needs unregistered? For all my script knows, there's still a device with collector installed that has that version checked out. I am not close enough to the staff to know of these occurrences and they don't think to tell us these sort of things.

by Anonymous User
Not applicable

Hi,

I am using Workflow 1 (Offline maps and versioned data—Documentation | ArcGIS Enterprise) and publishing my feature services from the Default version (not creating any child versions) to the portal and consuming them on the collector in Windows. I was wondering if I can still use the Script provided here (automate-reconcile-post-after-sync) to automate reconcile and post. I tried and getting an error "No versions to reconcile, aborting version maintenance routine".

Thanks

PJ

0 Kudos