Hello Everyone. Is there an easy and safe way to migrate from old keto relations-tuples to new ory p...
w
Hello Everyone. Is there an easy and safe way to migrate from old keto relations-tuples to new ory permissions language. I am trying to migrate an existing database of keto relations. For example one of our existing namespace name is
users
and with the opl will be
User
. Any recommendations on how should I do that without breaking anything and doing it in a safe way? It seems that the old relation tuples will be in the data base but it won't be possible to use them, so I will have to migrate them somehow.
s
what you can do is write the OPL to be compatible with the relation tuples, which then would mean the namespace is still called
users
once that works you can add a new version of the permission model parallel to the current one in parallel then you make your clients read, check & delete both variants in parallel, but only write the new ones and finally you can write a job that asynchronously queries for old tuples, and then creates the new version
after that you should only have new tuples, so then you can eventually remove the code for handling the legacy namespaces
btw I am currently doing the same and will write a docs page about the procedure once completed
w
Thank you Patrik!
s
do you want to go the full migration path? if yes, I'd be happy to review a migration plan once you have it ready and get your feedback on this
w
For now, we are just moving from namespaces defined in the YAML to the new namespace format using OPL. We are not going to change the namespace names for now. But when we do it we will do it as you have advice. So thanks a lot. We will do little steps for in the end get to do a full migration. But this will be in a long term thinking, It is not a priority right now. When we think about the full migration I will totally share it with you 🙂
s
👍 just adding to the permission model is easy