Best way to migrate custom Archetype -> Dexterity types while maintaining the ID and UID

Hello everybody,

we have in our system AT based contents with custom UID reference fields.

These fields hold only the target object UID as a string, and the field maintains back references etc. in the annotation storage.

We would like to migrate these contents to dexterity, but of course it would be best to maintain the UID and the ID of the object to reduce the reference resolving steps in the migration.

I have seen that there lives some code for migration in Products.contentmigration and plone.app.contenttypes.

Since I probably need to do the whole migration manually, I just wanted to know which would be the best starting point to do so, or if you could share some best practices with me how to achieve this the best way?

Many thanks in advance
Ramon

Hey Ramon,

maybe this post could help you:

Also I guess the egg "plone.app.transmogrifier" does something similar in the file "uidupdater.py".

1 Like

@ramonski see the docs at https://github.com/plone/plone.app.contenttypes#migrating-custom-content

In https://github.com/EUDAT-DPMT/pcp.contenttypes/blob/feature/plone52/src/pcp/contenttypes/custom_migration.py are a couple of examples where I migrated 22 custom archetypes types to dexterity. uuids, ids, annotations, portlets etc. pp. are all kept with this method.

If you also need to migrate relations from relationfields you should look at https://github.com/collective/collective.relationhelpers#dealing-with-archetypes-relations

3 Likes