I have 500+ versions in my production GIS database. As a regular maintenance, I need to run the version difference tool to check what versions are posted and what are not and generate a report every month so the posted versions (those with no edits in it) can be deleted safely. Using version difference tool in ArcMap is tedious work. Does anyone know if a geoprocess tool is available which can be used as script or model builder tool to automate this process? If this does not exist, if anyone can suggest a workaround to script/automate this, it will be highly appreciated.
Thank you.
There is no out of the box GP Tool for this yet. Ideas have been submitted for this:
Arcpy support for version changes
Version Changes - Ability to export results
Ability to get a 'change_set' within ArcPy
Similar GeoNet posts with some kind of solutions:
https://community.esri.com/message/454566?commentID=454566#comment-454566
https://community.esri.com/message/583495?commentID=583495#comment-583495
Python Script suggested in this link (not sure if this works, have to test yourself to find out):
I have 500+ versions in my production GIS database...
Holy smokes! That's a whole lot of reconciling and posting. If I may ask, why so many versions in a production database?
Because users not always delete their versions after posting them. and they keep stacking up. that is why need a way to identify which versions are posted.
Thanks!
Automate the process, so that even if the users don't....it will automatically Reconcile\Post\Delete the versions unless there is conflicts at the end of the day\week.
I cannot automate the Reconcile/post/delete or any of these because of the workflow the business has adopted. Even though as an admin, I can just recommend but cannot post or delete the versions.
I see. When I first started in the SDE/versioned environment, I had a dozen or so versions; one for each user. That got out of hand in a hurray as I was forced to make the decision on which way to resolve conflicts; if I reconciled and posted user A's version, I might get a conflict sometime later when reconciling and posting user J's version. That lasted about 6 months and was back in the SDE 8.x days. Since then I've only had sde.default and one 'edits' version.
Giving the scenario a second thought, the "Reconcile Versions" tool should do the needed for you.
If you select the options of 'Abort if Conflict Detected' and 'Delete Version after post" combo, then only those versions will be deleted which have been Reconciled\Posted successfully to the Target Version selected (this part is IMPORTANT to consider) and do not have a child version of their own.
So, if you kind off just need a Report or the log details, it will have something like below in case of a conflict:
Thanks Asrujit.
I did review the links you suggested and I have been though most of them already. In fact tried the python script to extract edits before reconcile/post but the problem with that script is that it fails with larger feature classes with a memory error. I am looking into how I can use the reconcile gptool as you have suggested. Again, I cannot post or delete the version nor even reconcile them without user's consent.
I am trying this option but not sure how would it tell if there are any edits in the version. There can be some edits but still no conflicts against the default.