Which GeoProcessing Tool deletes all the Feature Class records and ALL the attachments?
I guess the bigger question for this workflow is: Why not share it as a service from the enterprise GDB in the first place, rather than hosting it?
Yes, at least with python 3, if you set the maintain attachments and preserve global id's environment variable, then the attachments will be appended with the features (as long as they are enabled on the fc also) and will retain the existing Global ID's.
I use this all the time. I published my SDE data to AGOL as hosted feature layer, have lots of editing on the AGOL version, run a script that looks at the Global ID's in my SDE data, and the AGOL data. Anything that is in the HFS, but not the SDE gets appended to the SDE so that I have a backup copy of the data, attachments and all (and, of course, one that responds much faster than any AGOL data).
This, does NOT, however, work the other way. Seems there is no 'simple' way to copy data from SDE to AGOL with the attachments.
R_
Not really following the attachments part...
Assuming the FC and Attachments in the target are EMPTY
Not sure how that workflow works....
It depends.
Append would definitely work to add the features back in to your feature class.
Attachments are a little more complicated. Appending from another Attachment table would get the records in, but you'd manually have to change the relGlobalID to make them match.
Using the Add Attachments (and generate match table) tool is slower, but it works on attachments sitting in a folder.
If I use Append ... does that add Features and Attachments back ?
Yes, run it twice.
OK so there is on tool that does both I have to address but the FC and Attach Table
Yes this is an enterprise GDB
Assuming it's in a geodatabase, rather than AGOL, you want to use Truncate on both the feature class ("....gdb\exampleFc") and the attachment table ("....gdb\exampleFc__ATTACH") Note: There are two underscores before ATTACH
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.