Administration: Turn on database storage for configuration files
Sitefinity CMS configurations are stored in .config files. By default, these files are located in folder ~/App_Data/Sitefinity/Configuration/. When you have multiple Windows Azure instances or you have a Network Load Balancing with many nodes, you need to have the same configurations for all instances, since Sitefinity CMS does not handle .config file synchronization between different instances. You can store the configurations of different servers in the database. This way, all servers will use the same configurations.
PREREQUISITES:
- If you are moving the configurations of more than one instance to a common database, you must ensure that prior to the move, all configurations of different instances are the same.
- Database storage for configuration files can be turned on only for existing projects. New projects have to be created and initialized first, before proceeding with the instructions below.
NOTE: When you add or delete a language on your site, the changes are persisted on the file system, regardless the storage mode that you have configured. The changes are saved in the ResourceConfig
file.
This is because languages are part of the building of the metadata source for connecting to the database. In addition, changing the languages changes the database structure and all structural changes are transferred through the deployment package
To turn on database storage for configuration files, perform the following:
- Open you web.config file.
- Uncomment the following:
<
sectionGroup
name
=
"telerik"
>
<
section
name
=
"sitefinity"
type
=
"Telerik.Sitefinity.Configuration.SectionHandler, Telerik.Sitefinity"
requirePermission
=
"false"
/>
</
sectionGroup
>
- Uncomment the following:
<
telerik
>
<
sitefinity
>
<
environment
platform
=
"WindowsAzure"
/>
<
sitefinityConfig
storageMode
=
"Database"
/>
</
sitefinity
>
</
telerik
>
- If you are not using Windows Azure, comment or delete the following line:
<
environment
platform
=
"WindowsAzure"
/>
- Perform procedure Administration: Move the database connection string in the web.config file.
- Save and close the web.config and restart the application.
The storage of configuration files is moved to the database. The existing configurations are taken as default. The files in ~/App_Data/Sitefinity/Configuration folder are made read-only and any future changes to the .config files are written to the database where each server can access them.
IMPORTANT: You must not remove existing configuration files from the project's ~/App_Data/Sitefinity/Configuration folder, because Sitefinity CMS continues to use them to read the default values. Only new changes are written to the database.