Switching from serial keys to UUID keys

While creating videos on my YouTube channel for my beginner/intermediate series of videos, a viewer asked if I would create a video about migrating from using Serial values as primary/foreign keys to using UUID key values.

The process is actually quite simple, but not so obvious when you start thinking about all the scripting you might have to do for all the various tables and connections within your solution. The benefits of switching to a UUID key based system is that you no longer have worry about duplicates with disconnected files and you also gain the piece of mind that you don't have to worry about updating the serial value every time you perform an export/import process for updating a database which is not updated directly within production.

So, in this video, I show the easiest method for moving from using serial key values to using the more modern UUID values. If you have an older FileMaker system and you'd like to update it to UUID keys, then this video should have all the info you need.

Comments

Hi Matt,

I wouldn't do this with a replace as all records will change modification date. I use the import command for this without the checkbox for auto-enter options checked.

Kind regards

Thanks Joost! Yes, for anyone who is particularly interested in maintaining any auto-enter values of modification dates, you'll be able to avoid them from being changed by doing the import without the auto-enter options on.

However, in my case, I typically like to see that the record is modified because it will show it was modified by me when logged in as a developer. Otherwise, the very next time the record is modified by a user account it will be updated to indicate as such.

Just a matter of preference. Thanks for the tip!

-- Matt Petrowsky - ISO FileMaker Magazine Editor

Sequential IDs served for sorting purposes too and were fast in it. Applying UUIDs which of course is great for safety of mobile use, requires creating additional sequence field and administrating it, which is something to remember about when switching an old database to UUIDs. Or you recommend a different approach to solving the sorting matter?

Tomasz

couldn't I just the calculation for all primary ids ti use UUID
any new records will be UUID all old records will remain serial ids

any thoughts?

Peter Cortiel

Hi Matt, great video.
So far so good. But now you have to change and update all valuelists, put UUID fk fields in the portal items, so that choosing new line items actually still shows Product001 but behind the scenes put in the UUID into the fk field. Any intelligent way to handle all this? Also.. if you take sistem like this offline.. OK. The UUID are unique.. but if you let a INV001 type of id living.. user on the road still will create duplicates.. how to look out for that?

Hi Matt,
Nice video, my question is very simple if am building a new invoicing solutions i don't want to use serial id for my invoice number how does this work.
Can I use the first four numbers, or the last four numbers of the uuid, or do I have to use the entire number as an invoice number.