I have a layer in an ArcGIS Enterprise feature class (v 11.1), and I have a corresponding (but disconnected) hosted copy of it in AGOL; both layers have attachments enabled. The AGOL version is updated by contractors, and then I want to sync it down to my enterprise version.
Originally, I figured I'd just compare edit dates / create dates using Select By Attribute, but then I see that the edit field is not updated when an attachment is added / replaced, so comparing only the date field does not seem reliable. My logic would be something like:
for (row in AGOL hosted fc):
if( {AGOL hosted ID is new}): # new record found
# append
elif( {AGOL hosted edit date} > {EGDB fc edit date}):
# overwrite
elif( {AGOL hosted edit date} < {EDGD fc edit date}):
# flag for manual review
else: # edit dates are the same
# some logic to compare attachments.
# If AGOL has the newer one, then replace the EGDB attachment.
# IF EGDB has the newer one, then flag for manual review
Is there a simple way to compare the attachments so I can know which record is newer?
I guess a file-by-file comparison is possible, but that seems cumbersome since it'd require downloading every attachment for byte comparison. Portal + AGOL collaboration is not an option.
ArcGIS Pro 3.1/3.3 solution preferred (model builder, tasks, gp tools, etc.), but open to Python options as well.