As of Backdrop 1.28.0 it is possible to store site configuration in the database.
To use the new database storage for configuration, it can be enabled in settings.php
. Note that if settings.php is changed to swap configuration to a different location, the configuration must be moved beforehand. On new sites, this setting needs to be modified in settings.php
before running the Installer. On existing sites, the contributed module Config Mover can help move configuration between locations on existing sites.
This is an advanced option that may be useful on websites sites running Backdrop in certain situations, such as with load-balanced servers or network-based file-systems.
By default, Backdrop still stores all configuration in the file system as JSON files. To configure it to use the database, uncomment or add the following line to your settings.php
file:
$settings['config_active_class'] = 'ConfigDatabaseStorage';
This same thing can be done for config_staging_class
. If not specified, the class ConfigFileStorage
is used. The same concept applies for staging
configuration, where it too can be stored in the database. However, the more common scenario is that staging
would be kept in the file system (so that it can be managed by version control software), while active
might be stored in the database.
Note that if the ConfigDatabaseStorage
class is used, the $config_directories
variable no longer has an effect and can be removed.
API Changes: New Class Added
A new class ConfigDatabaseStorage
has been added, as an alternative to ConfigFileStorage
.
Other Changes
Additionally, the function backdrop_install_config_directories()
has changed, and is now named backdrop_install_config_location()
.