Workflow using Drush

Last updated on
1 October 2016

This page assumes you are familiar with using Drush, and that you have the latest version.

The following example shows how to export changes from development to production sites. The reverse is also possible.

  1. Install Drupal 8. We will call this site "Live."
  2. Make a copy of this site (We'll call this "Development"). Make the copy by using the same source code, the files directory and a database dump of the Live site imported on Development. With Drupal 7 you would have only needed the database dump and uploaded files, in Drupal 8, other parts of the file directory are relevant, including the configuration and PHP files. A full copy of the site will do.
    Upon completion of #1613424: Allow a site to be installed from existing configuration, it will be possible to install a fresh site from existing configuration, so copying the site will be as easy as installing a new site with the configuration exported. Until that issue is fixed, you will need a full copy of the site.
  3. On the Development site, change the site name in admin/config/system/site-information
  4. In your terminal, go inside your Development site and write the command drush config-export. This exports the configuration to your sync directory. The current contents of your export directory (called "sync" by default) will be deleted.
  5. Use a tool (rsync, Git, FTP, SCP) to copy the content of the Development sync folder to the Live site's sync folder.
  6. Using a terminal, go inside your Live site and write the command drush config-import
  7. Drush will display the available configuration changes and prompt you with "Import the listed configuration changes? (y/n): ". Type "y" to confirm.

You may want to change the location of the sync directory.