Orchard Hungary is an archive

This site is now an archive. We'll keep it so the content is accessible, but we won't update it anymore. However, we frequently publish Orchard-related news on our other site Orchard Dojo, so be sure to check that out instead. And if you're interested in news about our Orchard development company, Lombiq, check out our website.

Moving Tenants across Orchard instances

Tags: Orchard, tenants, multitenancy

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!

No Comments