Having two instances of a CMS point to the same database

D D asked on August 29, 2016 17:42

Is it possible to set up two instances of the same website that point to the one database? I know you can use the site wizard to create two websites in one instance but they share the same code base. I'm referring to two physically separate code bases that are pulling from two different branches of code in our repository (one to master, the other to dev).

Is this possible?

Recent Answers


Laura Frese answered on August 29, 2016 18:07 (last edited on August 29, 2016 18:08)

Yes. Copy the site files into another folder and create another site in IIS that points to that folder.

0 votesVote for this answer Mark as a Correct answer

D D answered on August 29, 2016 18:37

I've done all of that and created a new site in IIS for it so there are two separate physical sites on the web server, but then I change the connection string in the web.config to point to the shared database and open the new site. Then I get the Invalid website message telling me to configure the website in the "Sites" application in the CMS to run from the new DNS.

When I do go in, since it's pointing to the existing database, it has an entry for the other instance of the site, modifying it wouldn't work and using New site wizard option seems as it would create a new site in the same codebase.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 29, 2016 18:43

The problem with this setup is it sounds like you want 2 different websites as well. So say www.domain1.com is how instnace 1 is bound in IIS. Then you have www.domain2.com bound to instance 2 in IIS. If you want access both www.domain1.com and www.domain2.com in different sites, you need to have 2 different sites or an alias setup on the one site.

Typically I'll run a setup like this with a site on a dev server and my local code connected to the same database. The dev server will run http://dev.domain.com and my local copy will simply run http://localhost. This setup is common but I typically don't run it on the same server.

0 votesVote for this answer Mark as a Correct answer

D D answered on August 29, 2016 18:49

Well I do have two different websites and domains; one is dev.domain.com and the other is feature.domain.com. Both on the same web server and both different sites in IIS. Currently they're both hitting separate databases and working just fine. I guess I'm not sure how I'd go back setting it up so when you go into the site application in the CMS, I see a listing for dev.domain.com on that domain, and I see feature.domain.com on that domain - both pointing to one database.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.