Select to view content in your preferred language

Migrating Hosted Feature Layer with Attachments and Related Table – GlobalID / Append Issues

36
0
yesterday
RafaeldePedro
Frequent Contributor

Hi folks,

Here goes my journey, any help will be immensely appreciated.

The task I’ve got is to transfer c.2000 records from one hosted feature layer to another. The source layer has become not fit for purpose, with redundant fields and lack of coherence. Instead, I have created a new GDB on ArcGIS Pro with a Feature Class and a related Table which then I published to ArcGIS Online, to populated with records and attachments from the source AGOL layer (Note: the source layer does not have a related table. This was created just for the new layer as it seems the most robust way to handle multiple monitoring visits to each record).

So, I published my layer and table (with a relationship established of one-to-many) and I went on to heavily customise the attribute behaviour on the Form Designer of Map Viewer using a variety of Arcade Expressions. So far, so good.

Next thing I did, and this is when things started to go wrong, was trying to populate my new feature layer with the records (and attachments) from the old one. I presumed that a simple Append tool where I specify in the environments to preserve GlobalIDs and Attachments would suffice. But not quite. That’s when I started getting schema related errors (WARNING 003414: dataset does not match schema and will not be appended). Technically a warning, not an error. But nothing appended so clearly it didn’t work.

The next thing I tried was to export the old feature class to a FGDB, which I downloaded and tried to append then onto my new Feature layer, but I continue to get the same error.

Finally, and I can’t remember how, I managed to transfer (or copy and paste) records across by losing the GlobalID. This is a problem as I need to transfer attachments as well. So I’ve tried a number of things from creating dummy GlobalID fields so I could join the value somehow and use it to bring in attachments separately; created middle-man feature classes where I would try to clean any schema related issues with the Append tool, etc.

So, none of this worked, and I then also got the error message ERROR 003340: The target dataset must have a GlobalID field with a unique index.

At one point I managed somehow to bring in records without the attachments (or their original GlobalIDs) and then transferred attachments separately (using I believe ObjectIDs in one way or another) but with a very old result: while in general about half the records should have attachments (maybe one or two, four at most), the result I experienced was that most records had zero attachments and some of them had MANY (starting with one, two or few more but for a few records escalating to 10+ then 100+ attachments with the biggest number being over 400 attachments for a single record).

I ultimately turned to Copilot and ChatGPT and as per after going through a series of hoops I ended up where I started. One thing worth mentioning was how it pointed me to creating a GlobalID via geoprocessing tool (Add Global ID) rather than a manually creating a GUID field called Global ID. It suggested that under the layer properties/indexes, I should be able to see Global ID having unique values, but this has been so far impossible. The Unique value for the GlobalID field (regardless of how I create it) is No.

If you’ve managed to read through my stream of consciousness, is there anything in my process that resonates and is there any support you can offer?

Thank you in advance : )

0 Kudos
0 Replies