As the end of life (EOL) for Drupal 7 and Drupal 8 get closer, many long-time users of these platforms are concerned about whether they’ll be ready or able to upgrade their systems. While upgrading from Drupal 8 to Drupal 9 should be the easiest major Drupal upgrade ever, the upgrade from Drupal 7 remains a hard sticking point for many users and companies.
Many Drupal users and companies based around Drupal use and consulting have spent long hours creating and testing tools to help with moving off of older Drupal versions, onto newer ones. These tools become more and more critical as we near the end of life dates for older versions.
Upgrading from Drupal 7
Drupal 7 to Drupal 8 migrations require planning and potentially a significant amount of rewriting of code. The change to Composer and Symfony with Drupal 8 means that previous versions and methods of updating your code either don’t work as well, or in some cases, at all. Drupal 7’s end of life is November 2022 - making it less urgent than moving off of Drupal 8, but the effort involved is more significant.
Tools exist to help you get started with your upgrade from Drupal 7. While Drupal core provides a set of migration modules to help with data and content migrations from Drupal 7, it’s often just the start of your move to Drupal 8 or 9. The following modules and tools can assist you before, and during your migration. Some of them can even help you if you’re still running Drupal 6!
Upgrade Status
The Drupal 7 version of this module summarizes the Drupal 8 or Drupal 9 availability of modules currently in use on your website. If you’re not sure if everything you have in your website is ready, this module can help you find out. A significant number of major modules that went into Drupal core in Drupal 8 (Views being a primary one), which means that there’s a good likelihood that the community modules you use may already be available.
If you’re moving to Drupal 8 first, you’ll want to ensure your updates are also compatible with Drupal 9, use drupal-check and/or the Drupal 8 version of Upgrade Status. This is important for your own, localized custom modules. Read on for further details about Upgrade Status and drupal-check.
Drupal Module Upgrader
This command-line script scans the code of a Drupal 7 module. You can choose to analyze the code, or attempt to upgrade it. The module analysis flags code which is not ready for Drupal 8 or 9, points out API change notices, and will attempt to convert Drupal 7 code to a Drupal 8 and 9 version where possible. Drupal Module Upgrader does not use deprecated APIs in the code it generates for new module versions; if you’re upgrading to Drupal 8, you’ll have an easier path to move to Drupal 9 (this matters because Drupal 9 mostly removes APIs that were in Drupal 8 and deprecated over time.) It’s recommended that users of this module use the analysis first, so they know what they’re getting into, before fully diving into potentially broken code with an upgrade.
Migration Planner
The migration planner project is a Drush 9 command which generates a spreadsheet to help you plan your migration. It generates an output of your content types and what they contain. This can help you ensure your upgraded Drupal website has the appropriate fields to map to.
Migrate Upgrade
This addition to Drush can help you with your actual migration. It effectively is a drush version of the Drupal core Migrate module; it attempts to create a complete import of your website’s configuration and content from Drupal 6 or Drupal 7. You can choose to migrate just your configuration, or attempt to completely migrate. See the repository for full instructions.
Migrate Tools
With additional tools for managing Drupal 8 migrations, Migrate Tools provides Drush commands. They include tools for monitoring migrations and messages related to them.
Migrate Plus
The migrate_plus project provides extensions to core migration framework functionality, as well as examples. This includes extensions to the base API, some plugin types, and a group of additional plugins.
Migrate Run
This module is an alternative that doesn't depend on Migrate Plus. It's good for more drush support on top of core's API without the migrate_plus extras.
Deprecation testing
Deprecation testing is important - there’s a lot of code that’s been deprecated between Drupal 8 and 9 and there’s a lot that just changed. In many ways it seems to be a toss up between whether it’s easier to migrate to Drupal 8 and then upgrade to Drupal 9, or if it’s easier to migrate straight to Drupal 9. If you haven’t started your migration yet, it’s likely safest to upgrade to 9.1, because 8.9 will get fewer bug fixes over time. Drupal.org has a list of additional tools for deprecation checking, including tests run on Drupal.org code repositories.
Estimating upgrade time from Drupal 6 or Drupal 7
If you’re trying to make an educated guess about how long an upgrade will take, Luke Pekrul wrote a helpful Guide to Estimating an Upgrade to Drupal 8 (from Drupal 6 or 7). This guide includes references for some of your common but possibly complicated paths, content and configuration migration, and other considerations you should be aware of.
Drupal 7 summary: upgrade, or get Extended Support
Drupal 7 users may not be willing or able to move off of Drupal 7, even past the end of life date. This means Drupal 7 websites without a plan are potentially at risk. The Drupal 7 Extended Support program identifies vendors who are official members of the program. Tag1 Consulting was a pioneer of the Drupal 6 Long Term Support service, and is here to help you with your Drupal 7 website, whether you upgrade, or you want to remain on Drupal 7 for years to come.
Upgrading from Drupal 8
The process to upgrade from Drupal 8 to Drupal 9 is more streamlined than any previous major version upgrade. Drupal 9 is built directly from Drupal 8, and mostly removes deprecated code. The largest factor in Drupal 9 upgrade readiness is ensuring your modules and themes aren’t using any code that’s been removed. Drupal.org also has a list of third-party software changes that may have an impact on your upgrade.
Drupal 8’s end of life is November of 2021, so upgrading to Drupal 9 should be a priority. Several tools are available for Drupal 8 to 9 upgrades, including the previously mentioned Upgrade status, and drupal-check.
Upgrade Status
Any Drupal project that’s compatible with Drupal 9 should be compatible with Drupal 8.8+. Versions of Drupal greater than 8.8 are fully API-compatible with Drupal 9. Most modules should be able to keep the same code, even when they’re upgrading Drupal core.
The project page makes it clear - each release has a required version of Drupal. Tag1 Quo’s 3.01 release, for example, requires either Drupal 8.8 or greater, or Drupal 9 or greater.
If you’re not sure, the easiest path forward is to use the Upgrade Status module. Upgrade status checks your Drupal 8.8+ installation for you, and helps you understand what is compatible, and what isn’t, so you can correct it before you run into problems. It has many features, and builds on Drupal-check. It must be installed in a Drupal website, though it can be run against other Drupal websites where it is not installed; for example, you can run it from your development environment, against your staging environment.
Note: This module intentionally does not work on Drupal 9. It’s designed to help you upgrade your Drupal 8 websites. For most websites, it will be easier to go to Drupal 8.9, then to Drupal 9 to minimize code differences between core versions as well as contrib module versions.
Upgrade status looks at your entire website. If you need an overall readiness check, Upgrade Status is the clearest method of having that information at a glance.
Drupal-check
Drupal-check is a tool based on PHPStan, a static analysis tool. This kind of tool analyzes your code without executing it, Drupal-check is focused on Drupal’s specific needs. Run from the command line, it looks at an entire module, looking for deprecated code and other issues. It is website-independent, and does not need to be installed directly in Drupal.
Drupal Check is focused on PHP - if you’re updating PHP code, this may be more helpful as a quick double-check, rather than a full scan.
Rector
Palantir.net is continuing to develop Rector, a tool to automate code upgrades to Drupal 9. Drupal.org’s testing is using Rector for checks to show some of the module code that needs to be updated. These checks include PHP and Symfony upgrades.
Other checks
Acquia has created Deprecation graphs to show the percentage of Drupal modules that have reached compatibility with Drupal 9. Drupal.org’s testing looks for the types of errors in the code, from simple YAML file updates, to non-Drupal code deprecations and parsing errors.
Drupal 8 summary
One of the major reasons to upgrade from Drupal 8 to Drupal 9 is because Symfony 3, the version that Drupal 8 depends on, reaches end of life in November 2021. Drupal 9 is based on Symfony 4.4. During your upgrade plan, you can make your website accept both, while you work on resolving conflicts between versions.
Drupal 8 to Drupal 9 should be the least painful Drupal upgrade in the software’s history. The number of tools available to automate code updates and help clean up outdated information makes it less difficult to move forward. This also means it won’t make sense to have a Drupal 8 extended support program. The underlying software changes aren’t significant enough for an extended support program to make sense, like it did for Drupal 6 or Drupal 7.
For all of Tag1's content on Drupal end-of-life and what you need to know, see Drupal D7 & D8 End of Life.
Photo by Annie Spratt on Unsplash