In addition to using the interface to import and export configuration, it can also be triggered through Drush. The following commands are available:
- drush config-export: Exports all site configuration to the synchronization folder.
- drush config-import: Imports all site configuration from the synchronization folder. By default, this will delete any configuration on the system that is not present in the synchronization folder; you can provide the --partial flag to avoid this behavior.
- drush config-pull: Exports configuration from one remote site and copies it to another; for example, drush config-pull @live @self will export all configuration on the site at the @live alias and copy the files down to the current site.
- drush config-list: Lists all configuration objects on the site.
- drush config-set: Directly sets a configuration value in the database.
- drush config-get: Returns the value of a configuration object.
- drush config-edit: Opens the system editor, for example nano or vim, for the provided configuration object and then imports the value when it closes.
To transfer site configuration from one site to another, you would perform the following actions:
- Make changes to site configuration.
- Run drush config-export to update the synchronized configuration.
- Commit file changes to the version control system.
- Retrieve file changes from the target system.
- Run drush config-import to update the target system's configuration to match.