Hello,
I have a situation involving the evolution of my application to Multi-tenant.
I currently have a client in production with all its data and processes working correctly.
In the development environment I have transformed the entire application to Multi Tenant, everything has been tested and is working.
My problem is that when I create the new Tenants, the data from this old client, deployed to a single Tenant, is stored in the default Tenant (Users).
Does anyone know of a tool or documentation to guide the migration of data from one Tenant to another?
I would not want to leave a single customer in this default Tenant, as it breaks the user, rule and group handling logics too much.
Hey Enio,
You're welcome!
For what I know, you need to do it manually. If you do it on the database or via backend logic, it's your choice. I had a similar situation in the last year, and it's annoying to do it manually, but it was the only way me and my colleagues were able to change from single to multi-tenant.
Hi @Enio Junior ,
I don't know if you already have the answer, but here's something that might help you.
There's this forum post with a lot of discussion about changing single tenant entities to multi-tenant: https://www.outsystems.com/forums/discussion/59533/convert-existing-entity-to-multi-tenant/
You also have the outsystems documentation about multi-tenancy: https://success.outsystems.com/Documentation/How-to_Guides/Development/How_to_Build_a_Multi-tenant_Application
Answering your question: yes, when you change an entity from single to multi-tenant, the associated tenant becomes the Users because it's the user provider for the module where you have the entity.
To be able to separate the data between other tenants, you need to have them created and then create the data you need. You can expose the tenant id to easily assign that field when creating the data after that change. Please remember that having the tenant id exposed implies that you need to filter queries/assign that value in your actions.
If you only need to copy the data you already have to the other tenants, that can be quite easy with a bulk insert, for example, where you set the tenant id as well.
I hope this helps you!
Hi Laura!
Thank you for your reply.
The concept of multi-tenant tables and how to create an application were very clear.
Now, the question is:
To migrate my XPTO client data that is stored in the Standard Tenant (20) to another Tenant, would I have to do it directly in the database or via backend?
Doesn't Outsystem have a process that can do this migration?
Hi Laura
Perfect. Once again, thank you very much for the answer.
Good to know that you have experienced this situation.
Now, I have one more doubt:
I will create the new Tenant to migrate the data and I have mapped all entities in my application.
I want to update the TenantIdentifier fields of all tables.
Can you tell me if this would be enough?
Yes, I believe it will work :)
If you still need assistance between tenant migration then you can help of MailsDaddy software. I have already done the migration from there.