This project is read-only.

Change an orchard site to be a tenant

Topics: Core, Installing Orchard, Troubleshooting
Mar 11, 2014 at 12:46 AM
Edited Mar 11, 2014 at 12:59 AM
I have an Orchard 1.7.2 site that's been sitting at a temp URL for a while now while a client and I can setup their content the way they want it to look. However they have offices in multiple cities, and they want to let each office maintain their own site content now. So I've proposed that the host orchard install be the "Please pick a city" landing page and then it would forward you to the appropriate tenant site.,, etc.
The site was pretty much finished when they decided this so I'd like to backup the database and copy it to be the default for each of the three tenants they want to setup, and then blow away what is now the host and do a fresh setup since all it will likely need is a single page with the tenant sites under it. I've got them setup but getting these tenants to function reliably is driving me up the wall. At first I thought it was because I was restoring the database using what the site looked like before they wanted multiple tenants, but just creating a fresh tenant by default is giving me the same problem.

I create the tenant, set the Host, and the URL prefix, set the connectionstring to an existing connection string that is essentially a blank database with the appropriate sql credentials. Save it, but when I click on Set Up I get Orchards friendly Page Not Found page. I noticed the site is putting in an extra forwardslash in the URL so I take it out, still a 404. I cycle the app pool, and I still get a 404. I wipe out everything in the the App-Data folder (except for the Sites folder), cycle the app pool, and still get a page not found message.

I don't remember ever having this much difficulty getting this to work with other sites but they were older versions of Orchard. Am I missing something or does multitenancy not work in 1.7.2?

Where in Orchard can I set breakpoints to try and track down what is going on with the URL resolving to a child tenant or looking for content in the host?
Mar 11, 2014 at 5:40 PM
So on 1.7.0, when I try to visit a tenant, all the tenants give me blank pages. If I am logged into the Host, then the three tenants work. This doesn't help me as I need them to work for anonymous users. Not sure why this is the behavior I get. With 1.7.1 I can get one of the three to work but the others still give blank pages. And on 1.7.2 none of the three tenants work and I get the Orchard Page Not Found page. I tried 1.8.0 (or 1.x as I believe it's called) but it almost appears like the page loads with template used for installing the database and not the theme I expected? I'm not entirely sure on this last one as I wrote most of the odd behavior off on 1.8 not being quite finished. That and I've been jumping from version to version so often trying to get one to work. Oh and all three tenants are the exact same database data. I restore them in between version changes in case any auto migrations change the data. Which is what really baffles me about the one that does work on 1.7.1 to be honest...