where to change the Database connection settings in Orchard MVC CMS

waqari picture waqari · Jan 24, 2011 · Viewed 18.7k times · Source

I set up a site in Orchard CMS. While choosing data storage settings I chose

Use an existing SQL Server(or SQL Express) database

Instead of

Use built-in data storage(SQL Server compact)

It has worked fine for me but I am wondering where to change the data source that is the database server name. I didn't find the connection string settings in web.config file.

Answer

Jan_V picture Jan_V · Jan 29, 2011

To change the database, you should edit the DataConnectionString entry in the App_Data\Sites\Default\settings.txt file.

It should look something like this:

Name: Default
DataProvider: SqlServer
DataConnectionString: Data Source=servername;Initial Catalog=dbname;User Id=username;Password=password;

You do need to restart the website after the change is made. If you can't reset the webserver yourself, edit in the web.config (add a space) or in the bin directory should suffice. .NET resets the website when something happens in this file or folder.