Chance Grissom
Development Director

 

At Motionstrand we have the good fortune to work with a wide variety of clients. A portion of them operate in industries that have a legal and regulatory review process to ensure the claims they are making on their websites can be substantiated. These review teams could be peers or legal professionals who are tasked with providing proof of all claims expressed in any promotional material, including their web presence.

Over years of working with these systems we have come up with the following advice to make the process as smooth as possible, while utilizing the power that Drupal brings to your content publishing workflow.
 


Use a version control system

Using Git (or a comparable version control system) and having an overarching branching strategy is a must. Knowing exactly what code you have on your production server, and a history of all the changes to the codebase is invaluable for peace of mind and onboarding new team members. 

It is important that your team is consistent in their use of your selected branching strategy. We have found that having a release branch that only contains the latest approved code & topic branches for any development work, allows us to work more efficiently. Having a dedicated release branch also has the advantage of easy hotfixes should the need arise.


Have multiple instances of your website

Your hosting strategy should allow for multiple copies of your site to be hosted concurrently. At a minimum you will want two, a live production site and a staging site, to review any proposed upcoming changes. Legal review teams often want to review any changes to the content, layout or functionality in their natural habitat. For this purpose a password protected staging site is ideal.

If you have multiple projects happening on your website you might find it beneficial to have multiple development sites to review each initiatives progress. When they are approved they can be merged into your staging site and, after peer review, get deployed to production.

A Drupal website can be thought of as three main components, the Database, the Code, and the User Files. When updating production only the Code should ever be updated. As a general rule the database should not get overwritten with the database that was on your staging site. This ensures that no user data is ever lost. It does have the drawback of making deployments a little more complex, luckily there are plenty of tools at your disposal which I’ll discuss below.


Automate, Automate, Automate

There are several Drupal solutions which allow you to deploy updates without overwriting the database, and without any site downtime. At Motionstrand we have found the following approaches especially helpful when working within these regulated industries.

Custom Modules with Update Hooks

One common solution we have found is to use our custom modules update hooks. Your update functions will only run one time and are a great way to:

  • Update your existing database schema
  • Add new fields to your content types
  • Update saved data for existing fields
  • Add new custom blocks, and set their display settings programmatically

Once written they are easy to test against the production database in one of your test environments. Your module update functions get executed as soon as you run Drupal’s main update.php process, which should be a part of your new deployment workflow. You can also run it manually from within Drupal’s UI, or with the command line utility Drush.

Configuration Sync

Drupal 8 also brings the ability to sync configuration between environments. You can leverage this to build out new content Types, views, vocabularies, forms, menus and more on your staging environment while you are testing. Then when you are happy with the setup you can export your configuration to your code repository and import it on your production site. One important note is that configuration sync does not save any of the actual content, just how the site is configured. All of the content (e.g. individual  nodes, blocks, entities) still lives in the database and user files.

Publishing System

If you have a lot of new content that needs to get peer reviewed a good strategy might be to create it on production but leave it unpublished. Then sync your production database and files to your staging environment and publish them there for review & theming. This ensures that when you do get approval to show the new content on your live site, it will be as simple as publishing the pages and they will look exactly as your reviewers saw it.

Deployments are sometimes simple and can be accomplished by one of the solutions above but often require a mix of the above approaches. For example if your client wants to add a new ‘News’ section to their site one approach might be to:

  1. Copy your production database & files to a development environment.
  2. Build and test out your configuration to the functionality specifications of the new News content type & any related entities like taxonomy terms.
  3. Use the Configuration Sync tool to deploy your content type changes to production.
  4. On production, create your initial news articles but leave them unpublished.
  5. Copy your production database & files to a staging environment and publish your articles.
  6. Create a view to display the articles on the homepage & configure the article display to match the approved design.
  7. Initiate the peer review process.
  8. Repeat steps 2 - 7 as needed.
  9. Once approved, publish the articles on production while syncing your configuration to import your views, blocks & field display settings.

Even simplified for brevity it can appear to be quite a large task but in an industry with such high scrutiny any claim can have a large financial impact. Accuracy and reliability are far more important than speed. Drupal provides a very comprehensive set of core tools which can deliver consistently accurate results when leveraged correctly. Ultimately the solution best for your business will be a combination of tools and processes custom to your review workflow.

We hope this summary helps you ideate on how to better leverage the tools at your disposal for flawless content delivery. If you’d like any advice on what solutions Motionstrand would recommend or learn about automated tools we have built to ease the review process, please reach out. We’d love the opportunity to talk with you.


Join Our Team

Careers