top of page
Writer's picture2toucans

Drupal 8 Development & Deployment: A step by step guide

Updated: Apr 4, 2019


We recently finished working for a digital agency without in-house Drupal expertise working on their first Drupal project. We delivered a really cool website built really well with a great content editor experience.

I always recommend handling deployments using a CI tool (Continuous Integration) to automate things as it is more reliable as reduced human error due to automation. It’s also faster to deploy, and in case of any issues quicker to rollback. I recommend tools include Jenkins CI, GitLab CI or using Drupal cloud hosting companies that have their own CI built into their product such as amazee.io (my preference whenever I host a Drupal website).

They have deployed onto their client’s hosting infrastructure which is not currently setup for auto-deployments which is a shame, but it will be fixed as soon as the Technical Director gets a chance. As a result they needed a step by step guide on what to do while we're no longer supporting them.

Although many of the steps can be automated in many different ways, and are recommended, they should always do this.

Development (if Production database config was changed directly)

Firstly this shouldn’t be done and is not recommended as it can cause differences between configuration during deployment and therefore issues.

For extra peace of mind, I recommend installing https://www.drupal.org/project/config_readonly to avoid this

Get a DB dump from Live and restore it to your local development siteExport configuration : drush cex -yGit commit, git pushContinue to the section below `Development`

Development

Git pullComposer install (in case other developers made changes)Apply database updates : drush updbImport configuration (in case other developers made changes) : drush cim -yClear caches : drush crStart workFinish workExport configuration : drush cex -yGit commit, git push

Deployment to Staging

I’ve replaced the Drush commands with things that can be done by a non-developer through the UI if logged in as a user with the Administrator role

Get a DB dump from Live and restore it to the Staging siteDeploy the latest codeApply database updates : go to /update.phpImport configuration : /admin/config/development/configuration, review all changes make sense/are expected, then click `Import All`Check that all new expected functionality has now been deployedClear caches : /admin/config/development/performance, then click `Clear All Caches`Test to see what logged out users see

Deployment to Live

I’ve replaced the drush commands with things that can be done by a non-developer through the UI if logged in as a user with the Administrator role

Deploy the latest codeApply database updates : go to /update.phpImport configuration : /admin/config/development/configuration, review all changes make sense/are expected, then click `Import All`Check that all new expected functionality has now been deployedClear caches : /admin/config/development/performance, then click `Clear All Caches`Test to see what logged out users see 📷


Director / Web Developer

8 views0 comments

Comments


bottom of page