How to Create Multiple site in one sitefinity website?

Posted by Community Admin on 04-Aug-2018 09:06

How to Create Multiple site in one sitefinity website?

All Replies

Posted by Community Admin on 31-Jan-2012 00:00

Hi,
I am using Sitefinity 4.4 version. I have multiple sites that I need to build and I want to use one sitefinity website and different database for each site.
Is there a way to dynamically change the DB connection on the fly?


Thanks,
Pravat Sharma.

Posted by Community Admin on 02-Feb-2012 00:00

Hi Pravat,

At the moment multiple site management is not coming as out of the box feature, and changing the database used by the project with another one may cause errors, due to the fact that we store some sensitive information in the configuration files, which are related to a particular database ( ex. project name, role id's, etc. ). However you can create a single website and replicate the database few times and customize each one of the databases ( so there are practically 4 databases serving one site ). Such scenario is not tested but you can try to switch between the databases on the fly by getting the current connection string, editing it and setting the new one as a primary connection string. For example you can get a particular connection string by its name:

var connString2 = Config.Get<DataConfig>().ConnectionStrings["Sitefinity"];
       string strConnString = connString2.ConnectionString;

then you need to write some logic where you complete the process. I have googled few articles for you:

http://codebetter.com/petervanooijen/2006/08/11/change-a-database-connection-string-from-code/

http://www.codeproject.com/Articles/19578/How-to-persist-changes-to-My-Settings-ConnectionSt

social.msdn.microsoft.com/.../

Kind regards,
Victor Velev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed