0
votes

I'm setting up an Umbraco application with multi-tenancy where i need to change the database connection string dynamically based on the tenant selected.

i have not found any way of changing the connection string of Umbraco as it only works with the connection string named as umbracoDbDSN . I also have tried by downloading the source code of the Umbraco but it seems changing the ConnectionString in the Web.config file itself.

Does anyone know how can i achieve this?

Any Help will be appreciated.

1

1 Answers

1
votes

I don't think Umbraco will work if you try and do this. When you run Umbraco as a multi-tenant install it usually uses the same DB for all the sites you run on the install.

The issue you will run into is that Umbraco will generate it's cache files etc that power the site from the DB, so every time you switch DB, those cache files will be regenerated based on the NEW database, so ALL tenets would display the content of the last database that was used.

If you need to have client specific data, you could always have a SEPARATE database for each client to store that client specific data in addition to the main core database that Umbraco uses.