-
Notifications
You must be signed in to change notification settings - Fork 10
Config Split
Config Split is a Drupal 10 module that enhances Drupal's configuration management system by allowing administrators to define sets of configuration items that can be split from the main configuration. This functionality is particularly useful for managing different configuration sets across various environments (development, staging, production) and for separating site-specific configuration from core functionality.
- Complete Split: Configuration listed here will be removed from the sync directory and saved in the split storage instead. Modules will be removed from core.extension when exporting (and added back when importing with the split enabled.). Config dependencies are updated and their changes are recorded in a config patch saved in in the split storage.
- Partial Split: Configuration listed here will be left untouched in the main sync directory. The currently active version will be compared to the config in the sync directory and what is different is saved to the split storage as a config patch. Use this for configuration that is different on your site but which should also remain in the main sync directory.
Config splits are handled through normal config import/export
# Export configuration split
bin/drush cex
# Import configuration split
bin/drush cim
$config['config_split.config_split.local_split']['status'] = TRUE;
$config['config_split.config_split.cloud_split']['status'] = FALSE;
$config['config_split.config_split.local_split']['status'] = FALSE;
$config['config_split.config_split.cloud_split']['status'] = TRUE;
After copying a remote database to local, drush cim
will import only the configuration in the development split leaving the rest of the configuration from production intact. Now your local (active) configuration contains the production config + the split. Export the production config with drush cex
to have the config in git. Continue development, drush cex
, deploy code and configuration and on remote environment drush cim
(this will ignore the non-active split even if config_split is enabled)