Configuration Management
Reviewed 230525
This article covers config split in a very cursory fashion. For more detail see Configuration Split.
Setup
Make sure your settings.php defines the sync directory. Put it in the Drupal install directory unless you have a good reason to do otherwise.
/** * Place the config directory outside of the Drupal root. */ $settings['config_sync_directory'] = dirname(DRUPAL_ROOT) . '/config/sync';
Export all the configuration from your site (see steps 3-5 below), and commit it to your config directory.
Saving Config Changes
You can export config via the admin interface or by using drush. In most cases, it is more efficient to use drush.
Exporting config changes for a Pull Request | ||
---|---|---|
Via the Admin Interface | Using Drush | |
1 | Make database changes (e.g. change permissions) | |
2 | Create a new feature branch | |
3 | Visit |
|
4 | Uncompress the .tar.gz file system downloaded, and copy the config to your config directory | drush already exported the files where they need to go |
5 | If any of your changes are covered by config split, visit | drush exports config splits at the same time |
6 | Add the config changes needed for your PR. Do not check in changes unrelated to your feature. i.e. | |
7 | commit your changes | |
8 | Push your changes | |
9 | Open a pull request from your feature branch |
Loading Config Changes
You'll want to import new config changes to the database when you bring down new config changes through git. To do this:
git pull the changes into your repo
Import the configs
Visit /admin/config/development/configuration and click Import All or runÂ
drush config-import
AKAÂdrush cim
If using the admin interface, and importing configuration covered by config split, visit
/admin/config/development/configuration/config-split
click the dropdown to the right of your active environment, click Import, and then Import All.
Review History
Who | When | Status |
---|---|---|
 |  |  |
Bob | 20230525 | Current |