Move the database connection string in the web.config file
By default, Sitefinity CMS stores the connection string to the database in the DataConfig.config file, located in folder ~/App_Data/Sitefinity/Configuration/. You can move the connection string to the web.config file, if this is required.
To do this, perform the following:
- Open the
DataConfig.configfile and copy and delete the<connectionStrings>section, which contains the connection string. - Save and close the
DataConfig.configfile. - Open your
web.configfile and paste the copied section inside section<configuration>, after the</configSections>tag. - Delete the
dbTypeattribute, because it is not supported in theweb.config. - Add a parameter
Backendinside the connection string. - Save and close the
web.configfile.
EXAMPLE: The following are examples of connection strings:
- Connection string section in the
DataConfig.config:XML<connectionStrings> <add connectionString="data source=ABC;Integrated Security=SSPI;initial catalog=xyz" providerName="System.Data.SqlClient" dbType="MsSql" name="Sitefinity" /> </connectionStrings>- Connection string section in the
web.config:XML<connectionStrings> <add connectionString="data source=ABC;Integrated Security=SSPI;initial catalog=xyz;Backend=mssql" providerName="System.Data.SqlClient" name="Sitefinity" /> </connectionStrings>
NOTE: If you have connection strings with the same name in the
DataConfig.configand in theweb.configfiles, the one in theDataConfig.configfile will be ignored.
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
Get started with Integration Hub | Sitefinity Cloud
This free lesson teaches administrators, marketers, and other business professionals how to use Sitefinity Integration Hub to create automated workflows between Sitefinity and other business systems.
Web Security for Sitefinity Administrators
This free lesson teaches administrators the basics about protecting your Sitefinity instance and your sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
Foundations of Sitefinity ASP.NET Core Development
The free on-demand video course teaches developers how to use Sitefinity ASP.NET Core and take advantage of its decoupled architecture and modern development model.