Combining Individual Sites To Multi-Tenant Environment

Topics: Administration, General, Installing Orchard
Jul 2, 2013 at 11:43 AM
We are setting up four sites using Orchard and development of two of them has already been done locally on individual desktop machines using the compact database. We want to set up a single server that runs multi-tenant with SQL Server. I'm looking for suggestions on how we can migrate the sites over to the single environment. From my limited (so far) experimentation, we can't just migrate the data from each of the two sites using the migration tool into a single database because the migration tool fails if the data tables exist or the other option is to drop and recreate, which loses the first site. Also is the key issue since in both cases the sites are "id=1" so that would represent an issue. Last resort is to have four separate databases, or at least two (where we are able to add the additional two sites directly in the new environment and not have to migrate them).
Jul 5, 2013 at 7:22 PM
See this discussion on how to migrate from SQL CE to a common DB where tenant tables are prefixed:

You'll need to set the prefix in the Settings.txts of the tenants too through the DataPrefix property. The best would be for you to quickly set up an Orchard site locally with a standard DB, then mimic the Settings.txt file that will be created there.
Jul 12, 2013 at 2:10 PM
Thanks, Pierdone. I actually had ended up doing the following: I set up each of the tenant sites specifying that the database would be provided. Then, for each of the tentants on the local development machines that were using the compact SQL, I edited the tables to add the prefix to the table names. I then used the migration tool to migrate to the common SQL repository. Finally, I completed the setup on the server to specify the db server and the prefix. Worked like a champ.
Jul 12, 2013 at 2:17 PM
Great to hear :-).