Migrating Your Government Site to Drupal 8

Brian Tofte-Schumacher

Technical Architect, Forum One

Drupal 9 was released earlier this month. Exciting! With any platform update or upgrade, there is a general feeling that getting onto the latest version is always the best approach. However, as government agencies look to tackle their Drupal migration strategy, migrating your government site to Drupal 8 from Drupal 7 is likely the best first step.

If you’ve been following the Drupal development roadmap, you’ll know that:

  • Moving from D7 to D8 is a big lift
  • Moving from D7 to D9 is a big lift
  • Moving from D8 to D9 is a light lift

So, which big lift should government agencies be considering in 2020? To answer this question, let’s consider the following.

Drupal 8’s Journey to Today

The release of Drupal 8 in 2015 brought significant improvements to the Drupal ecosystem. Tools like media management, layout builder, and an improved WYSIWYG editor have significantly streamlined the content editing experience, which is especially valuable to government agencies that have both complex and large content requirements. And with the content moderation and groups modules, tools to implement an automated content governance strategy are now fully integrated. Finally, in cases where Drupal doesn’t quite meet requirements out of the box, it has never been easier to extend or customize built-in functionality.

In the five years since Drupal 8 was released, it has matured into a stable product that is battle-tested and ready for enterprise websites. Most sites today rely on contributed modules to extend Drupal’s core functionality, and though there has been a lot of work put in by the community to prepare many Drupal 8 modules for Drupal 9 in time for release, there are many that haven’t been updated yet. 

While this Drupal 9 readiness work continues, the best path forward is migrating your government site to Drupal 8 from Drupal 7, ensuring any custom code is ready for a future upgrade. Once all the contributed modules needed are ready for Drupal 9, then the jump to Drupal 9 will be much more straightforward.

A Future-Proof Codebase

With Drupal 8’s release in 2015, the community wanted to break the cycle of major upgrades requiring a ground-up rewrite of a site. They did this by “future-proofing” the codebase through adopting a semantic versioning model and a six-month release cycle. This, coupled with a standard approach to code deprecation, allowed new features to be introduced gradually while maintaining backward compatibility.

Using this model, a migration into Drupal 8 is meant to be the last “big lift” migration needed— as all future updates will build off of the strength of Drupal 8. 

Setting the Course from Drupal 7 to 8

Moving content into Drupal 8 is accomplished through a robust set of migration tools, which can ingest data directly from a Drupal 7 database, a CSV file, an XML feed, and a non-Drupal MySQL database, among many other sources.

Government agencies can take this opportunity to streamline their content model and modernize the content editing experience during the migration process, for example, adopting Paragraphs and the updated media system. And the good news is that there are a number of standard tools to support moving content from Drupal 7 content types, field collections, and file fields into their Drupal 8 equivalents.

Case in point: 

Forum One is working with the Environmental Protection Agency (EPA) to migrate their flagship site to Drupal 8. It is an expansive site that uses many of Drupal 7’s more complex contributed modules, including Panelizer and Organic Groups. While both of these features have an equivalent (or replacement) in Drupal 8, the content cannot be imported one-to-one. This is where custom migration comes nicely into play.

On the EPA site, we’re implementing Layout Builder to replace Panelizer, which will allow content editors to create unique layouts on a node-by-node basis, replacing the functionality that Panelizer offered. Layout Builder provides an easy-to-use page builder for implementing landing pages and other types of rich content, giving content creators control of how their content is laid out, without requiring additional development resources to implement custom layouts.

Migrating Your Government Site to Drupal 8
Leveraging the strength of the migration ecosystem, we are able to extend existing tools instead of starting from scratch through a custom “source” plugin that reads Panelizer data from the Drupal 7 database and a custom “process” plugin to transform that data into Paragraphs and Blocks that are inserted into Layout Builder.

The migrate_tools and migrate_upgrade modules handle the connection to the Drupal 7 database and provide a framework for what a “source” plugin and a “process” plugin does. This is made possible by Drupal 8’s object-oriented approach, which was one of the major breaking changes from Drupal 7 to Drupal 8—but the ease of implementing custom logic made the change worth it. Much of the core functionality provided by Drupal 8 is written this way, allowing for features to be customized or extended in a standard way which results in more efficient development.

Forum One has recently helped a number of other federal agencies migrate their government site to Drupal 8 from Drupal 7, including USDA’s Food and Nutrition Service, DOE’s Pacific Northwest National Laboratory, HHS’s Health Resources and Services Administration, and Smithsonian’s National Museum of Natural History.

Written By

Brian Tofte-Schumacher

Technical Architect, Forum One

Migrating to Drupal 8 with Drupal 9 in Mind

To learn more about what’s changing from Drupal 8 to Drupal 9 and some tips for ensuring an easy upgrade, dig into Forum One’s Guide to Preparing for Drupal 9.