How do I export Drupal configuration?

Run drush cex from your project root. This exports all active configuration to YAML files in the directory defined in your settings. The default location is usually config/sync within your project.

After exporting, commit the resulting files to Git alongside your code. On another environment, pull the changes and run drush cim to import them.

You can also export configuration through the admin interface at Configuration then Configuration synchronisation, but Drush is faster and fits better into deployment scripts. Be careful about exporting on a site that has been modified locally, as it will overwrite the previous exported state. A good habit is to pull the latest code, import, make your changes, then export and commit. This keeps your config history clean and avoids conflicts.

Facebook
Twitter
LinkedIn
Pinterest