Moving Tenants across Orchard instances
A few days ago I was facing the task of "merging" two Orchard instances (both of them containing two tenants) into one. As a matter of fact I thought I was looking forward to a raging storm of errors but it turned out to be quite simple. There are two basic rules you must keep in mind:
- There must always be a tenant with the name "Default" (just like a Stark in a Winterfell),
- and tenant names must be unique.
Aside from those it's fairly easy. To ensure that all of your tenants work properly, you need to:
- Rename the to-be-moved tenant folders in App_Data/Sites to something else if there's a tenant with the same name in the destination instance.
- Move/copy every module the new tenants use but the others don't,
- move/copy the corresponding folders from App_Data/Sites,
- rename (if necessary, according to the tenant name) and move/copy the corresponding folders from Media to the merged instance.
- Finally, update the Name property in the Settings.txt of each tenant that was renamed.
And that's it!
I recommend you to check out the issues related to MultiTenancy in the GitHub issue tracker and Bertrand's blogpost about preventing failed requests of a tenant fall back to the "Default" one.
Happy tenant-configuration!