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.
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.
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:
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.
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.
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.
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".