Stackify is now BMC. Read theBlog

Drupal 9: Everything You Need to Know

  |  July 17, 2020
Drupal 9: Everything You Need to Know

Having developed web applications using Drupal 6, 7, and 8, the launch of Drupal 9 is incredibly exciting. Ironically, I started working with Drupal 6 at a time when Drupal 7 had already been released. However, there was a huge resistance in adopting Drupal 7 due to its incompatibility with contributed (open source) modules. This often meant that adoption of Drupal 7 would prevent companies from using the modules their websites relied upon to function in their entirety.

New Drupal Release Cycle Process

The major update release cycle from Drupal 6 to 7 has altered drastically by comparison with Drupal 8 to 9. Drupal is now adamant on releasing a new major Drupal release that can provide a seamless update from a prior version, meaning the update process should be seamless for developers. So much so, that if you are using Drupal 8.8 or 8.9, with contributed themes and modules not having any deprecated functions, you’re already equipped for the upgrade.

Sounds neat, right?

However, why update if you don’t need to?

Do I Need to Update?

No, you don’t need to update. But it’s an update you’ll need to make eventually. With Drupal planning a new major version every 2-3 years under the revised structure, upgrading sooner prevents deferring the work to a later date (see this article detailing the software development life cycle). By observing the below release schedule (provided by our friends at Drupal), you’ll notice Drupal 9 has an end of life no time in the foreseeable future in the end of 2023. While this is a long way off, it does mean you have time on your side (see Drupal’s release life cycle here).

On the contrary, as a software developer loving everything open source, I’m a huge fan of leveraging the latest technologies. Drupal 9 (unlike Drupal 8) comes equipped with the latest versions of Symphony, CKEditor, and other packages, which won’t be updated within minor releases of Drupal 8. In updating, you have the latest iterations of these respective solutions. If this isn’t of interest, as previously mentioned, you can defer this update to a later time.

What Is Required to Update to Drupal 9?

Updating previously between major iterations of Drupal was much easier than it is now. The process of updating from Drupal 8 to 9 is incredibly easy if you’re already using the latest versions of these respective solutions. I always like to consider updates to Drupal as having three primary pillars:

  1. Modules
  2. Themes
  3. Data

If all three can be updated without too much difficulty, the upgrade process from Drupal 8 to 9 should be rather simple. Below is a brief summary of what is required within each facet:

  1. Modules
    Modules ultimately need to be separated into custom and contributed (where custom are those created for your website specifically and contributed are those available from the Drupal community). In the case of custom modules, these will need to first be upgraded to use no deprecated functions in Drupal API version 8.8 or 8.9. In doing this, the custom module will be ready for Drupal 9. Similarly, contributed modules have the same requirement, where the updates can either be executed by the community or yourself (in which case, you should raise a pull request to share these updates with the Drupal community).
  2. Themes
    Themes have a similar update process to custom Drupal modules. Thankfully, with Drupal themes not being as reliant upon the Drupal API (in most cases), this should be considerably easier. However, the theme will be updated to no longer use any functions that are deprecated in Drupal 8.8 or 8.9.
  3. Data
    Data is by far the most exciting part of the process for me. Drupal 9’s data migration process should be effortless. With any data migration between minor Drupal versions (and as mentioned by Drupal, the update process from Drupal 8 to 9 mimics that of a minor release), the upgrade is simple for both Drupal core and its contributed modules.

What Is the Update Process?

Updating Drupal from 8 to 9 is a five-step process.

Step 1: Prepare Your Server

Updating your server to the technology required by Drupal 9 is critical. This includes the following:

  • Apache: Version 2.4.7 or higher.
  • PHP: Version 7.3 or higher (but not 8).
  • Database (MySQL): Version 5.7.8 or higher.
  • Database (MariaDB): Version 10.3.7 or higher.
  • Database (SQLite): Version 3.26 or higher.
  • Database (PostgreSQL): Version 10 or higher.

Step 2: Update to Drupal 8.8 or 8.9

As previously mentioned, Drupal has recently released versions 8.8 and 8.9 as a midpoint between Drupal 8 and 9. Modules and themes developed for Drupal 8.8 and 8.9 are already compatible with Drupal 9. By updating to Drupal 8.8 or 8.9, you can then track any warnings or errors to determine if you are still using any deprecated Drupal APIs. You can trace errors with Stackify’s Application Performance Management tool, Retrace.  Try your free 14 day trial today! 

Step 3: Upgrade Status Module

The Upgrade Status module for Drupal is the Hail Mary to any woes you may face. By downloading the module (here) and installing it into your Drupal installation, you will be able to analyse your Drupal setup and confirm if there are any concerns you should have prior to the upgrade.

Step 4: Upgrade Custom Code

Per step 2, you should now be aware if any custom modules or themes are using deprecated Drupal APIs. If this is the circumstance, make sure you update these with versions compatible with Drupal 8.8 or 8.9 to prepare for the upgrade.

Step 5: Update Drupal Core Code and Database

It’s now time to update Drupal 8 to 9. By this stage, you should have Drupal 8.8 or 8.9 installed, with all modules and themes no longer producing any errors. If not, I recommend not proceeding the update to Drupal 9.

If you are ready, there are two steps:

  1. Update the Drupal Core codebase by following the steps provided by Drupal here.
  2. Update the Drupal Core database by navigating to update.php in your root directory (e.g. example.com/update.php). This will guide you through the process of upgrading your database.

Be sure to use Retrace to continue monitoring Drupal during and after completion of the update. It will help to ensure you resolve any issues and are provided with detailed reporting to resolve them urgently.

Further Reading

If you have any issues, please don’t hesitate to reach out to us here. You can also read a more detailed update guide for developers here, and Drupal’s upgrade guide here.

Improve Your Code with Retrace APM

Stackify's APM tools are used by thousands of .NET, Java, PHP, Node.js, Python, & Ruby developers all over the world.
Explore Retrace's product features to learn more.

Learn More

Want to contribute to the Stackify blog?

If you would like to be a guest contributor to the Stackify blog please reach out to [email protected]