26
votes

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.

4

4 Answers

47
votes

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.

8
votes
.\App_Data\Sites\Default\settings.txt

but you can't just change it to point to a empty database. the database needs to be prepared for orchard cms first.

3
votes

Take a look at .\App_Data\Sites\Default\settings.txt.

2
votes

To change connection string in Orchard you should go to Orchard.Web,in that App_Data\Sites\Default\Settings.Txt