Site Building
Topic

Deployment Workflows for Drupal 7, 8, 9, and 10

When working on a Drupal site it is good practice to use one or more separate environments to develop and test your site without impacting the live site’s availability to the world. Changes made to the code or configuration of your development site are then deployed via an automated (or manual) process in order to make them available on the live site. This allows you to, for example, create a new content type or change the configuration of your front page view in isolation so that you can preview the changes. You can then deploy those changes without having to resort to manually replicating the changes on the live site.

Drupal developers use a variety of different tools and Drupal APIs to facilitate the synchronization of code and configuration between environments. The complete process is known as a deployment workflow. At a very high level this includes the following steps:

  1. Make a change to configuration, or code, on a development environment
  2. Export any configuration changes to a file(s) that can be stored in version control
  3. Commit code and configuration changes to version control
  4. Synchronize version-controlled files to the live server
  5. Run database updates (update.php) and import any configuration changes
  6. Clear the cache

To improve the process further, figure out how to automate as much of that as possible using tools like Drush, Git, and continuous integration software. The goal is to create a repeatable, reliable process that reduces the time it takes, decreases downtime for your site, and minimize human error.

Drupal currently supports the deployment of code and configuration, but not user-generated content. For more on the difference between the two, see Configuration Data Types.

Workspaces module is a Core (Experimental) module (roadmap) that improves content workflow, preview, and staging abilities. Learn more in the original Workflow Initiative core idea issue.

Example tasks

  • Build a new View on your development environment and then deploy it to the production site
  • Test and configure a new module locally and then update the production site when ready
  • Make changes to your theme or module locally and deploy those changes to the live site

Confidence

Deployment, and specifically what tools to use and how to use them, continues to evolve. The recommendation of using a development > staging > live workflow whenever possible isn’t likely to change. The specifics of these workflows can vary, depending on your hosting provider and other factors. It’s best to get a general understanding of the desired workflow and then work with your team to define the specifics for your application and available tools.

Drupalize.Me resources

More information

Overview of development sites with an example deployment workflow for site building.

More information

How to make a copy of a live site for development purposes.

More information

How to copy a view created in a local development site to a production site.

More information

How to synchronize the configuration between a development and live site using the core Configuration Manager module.

More information

How to manage file and configuration revisions with the Git revision control tool.

More information

Learn about Drupal’s configuration system and how to manage configuration with both the administrative user interface and command-line tools.

Drupal 7

Essential tools

More information

The Git version control system can help you keep track of changes in your codebase and make sure you don't unintentionally lose work.

More information

Composer is the preferred dependency management solution for PHP, is used by Drupal core, and is becoming increasingly popular for managing the modules and themes used for a Drupal project.

More information

Drush is a command line interface that enables you to interact with your Drupal site without clicking around the graphical user interface (GUI).

Guides

Not sure where to start? Our guides provide useful learning tracks for all skill levels.

Navigate guides

External resources