where to change the Database connection settings in Orchard MVC CMS
Asked Answered
U

4

27

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.

Ursas answered 24/1, 2011 at 10:45 Comment(0)
T
48

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.

Toothbrush answered 29/1, 2011 at 15:19 Comment(1)
Apparently not everything in settings.txt is honored: github.com/OrchardCMS/Orchard/issues/4224 ("The connection string is dynamically generated and therefore doesn't use the settings.txt information so the Max Database Size is defaulting to 256 and cannot be increased.")Clathrate
P
8
.\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.

Pellicle answered 19/9, 2012 at 6:4 Comment(2)
Is this un the Orchard.Core appdata, or Orchard.Web?Hijacker
Actually, Orchard will create the initial database if one is not present. This is part of the core DataMigration feature.Tasha
C
3

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

Ceiling answered 24/1, 2011 at 13:40 Comment(1)
i modified Initial Catalog in dataconnectionstring but didn't work for me.After that i modified DataPrefix but it didn't work eitherUrsas
A
2

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

Arette answered 2/9, 2015 at 4:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.