I want to clone tenant
How would you go about developing such functionality?
Also, if it is difficult to duplicate the tenant, I would like to create a function to export the data of the copy source and import the data to the tenant of the copy destination. Is this possible?
ABP Framework version: Commercial 7.2
UI type: Angular
DB provider: EF Core
8 Answer(s)
-
0
hi
I want to clone tenant
You can get the target tenant info and create a new one.
if this is not your want please explain it in detail.
-
0
Yes, I want to create a new tenant by inheriting all information from the clone source. how do i do that?
-
0
Yes, I want to create a new tenant by inheriting all information from the clone source. how do i do that?
can you elaborate more on "all information"?
implementation varies on the specific definition.
for instance, you can just copy information on the tenant entity. do you want to transfer users as well?
are there entities that need to be copied as well?
are there any requirement that you copy created/ updated etc dates of any entities?
are there any requirements to store information about the source of where data has been copied from?
Generally spoken, you can do something like extending the tenant entity to store a source tenant. then, you could use DataSeeder's with the tenant filter disabled to perform the stuff you need.
Depending on your requirements, a background job may be a better fit, as copying data may take a while.
As you see - it all depends and the devil lies in the details.
-
0
thank you.
・Data of all entities. ・I want to copy the user and scope as well. ・I want to keep the timestamp.
-
0
hi
You can change the current and query all the entities of the tenant and create new for new tenant.
https://docs.abp.io/en/abp/latest/Multi-Tenancy#change-the-current-tenant
-
0
テナントのクローンを作成するためのサンプルコードはありますか?
-
0
hi
There is no sample code for now.
See https://support.abp.io/QA/Questions/5500#answer-3a0cc632-a4b3-d72f-73bf-29adde5c2e25
-
0
thx