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:
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:
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).
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.
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:
- Update the Drupal Core codebase by following the steps provided by Drupal here.
- 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.