Migrate from autoID module to UUID native system?

Hello to all
I was very happy to see that the recent versions of Kirby brought a native uuid system.
It rocks!
I have a big project, several hundred pages long, that I had built using @bnomei’s great autoID module (ids are used many times, and by many types of fields).
I would love to be able to migrate to the current versions and do without this module in favour of the native system.
My project version is still in 3.6.2
I haven’t found a specific topic on this issue. Has anyone tried this before?

you can upgrade to the most recent version of kirby and keep autoid if you want. you just need to “lock” its version to 2.8.1 (with composer without the ^ or downloading the zip directly).

the current uuid system does not support structures.

in theory you could migrate page/file/user relations like this but i have never done this myself.

  1. use string replacement and swap Autoid: to Uuid: in all content files
  2. where you used autoid() helper you can use page()/kirby()->file()/->user() directly.
  3. the bigger problem are relations as autoid values stored in select fields and you might want pages fields now. for that you would have to read the field and transform it from that comma seperated list to a proper page array.

Thank you Bruno,

I’m not sure, but I don’t think I’ve used any structure via autoID on this project (my memory fails me, I’ll check anyway).
But the project is full of select fields using autoIDs to link pages, files, and users…

So if I understand correctly, either I write a big migration script, or I continue to use autoID more pragmatically?

What motivated my decision to use uuids was the release of the Move Pages | Kirby CMS plugin, which I deduced had to be linked to the uuid system, and more generally the use of potential future plugins that would use this mechanism, so far absent from Kirby…

Move pages seems to be compatible with Kirby version 3.6. This means that the use of UUIDs is not mandatory…
In that case, I will probably continue with autoID for a while and use move pages directly.
I’ll reopen this ticket if I ever make a script that has some aspects worth sharing.
Thanks a lot

1 Like