Released on June 3rd, Drupal 9 is built to handle more data at higher volumes, integrate easily with other platforms, and lower the barriers to entry for new Drupal users. Drupal 9 has been in beta for quite some time, but the final release version has dropped earlier this month. In this article I’m going to walk through my experience, as VP of engineering at Boston Digital, in testing out D9 with our own agency base build. Before I do that, let’s talk about what has changed from version 8.
What is New With Drupal 9?
The biggest change with Drupal 9 is under the hood. The coding around modules and APIs have changed and are more modernized. In some cases they have been pulled out of the core codebase and now are declared as outside dependencies. In some ways this is great because it's future forward, giving flexibility to what Drupal can do, while also keeping it lean so it continues to be one of the fastest performing enterprise content management systems on the market
However, there can be issues if your website depends on these modules or APIs to function. The good news is that already over 50% of the modules on Drupal.org need no changes at all. Those that do need changes are noted and can be viewed on the module page to see the progress of this. There are a few tools that you can download right now to validate this. The first is the upgrade status module. This module is principally for Drupal 8, but can also be installed in Drupal 7 sites.
This is a great view to see what has and hasn’t changed in Drupal and links to the various module pages to review those changes:
The other module for developers is called Upgrade Reactor. This module offers automated code fix suggestions to make your modules compatible with Drupal 9. It only has partial coverage for depreciated APIs, but it’s a great starting point as you develop code. This is for Drupal 8 only and is still a work in progress.
Also if you’re an Acquia customer, they are developing a tool called Migrate Accelerator. This tool is low code and may work in certain situations for you. You can read more about it here. All of these tools give developers a way to see the path forward for Drupal 9 and the effort to upgrade their websites.
When Should I Upgrade to Drupal 9?
Drupal 9 did launch on June 3rd, however that doesn’t mean that it's ready for production websites right away. If you have an existing website you may want to wait a little bit for the ecosystem surrounding Drupal core to upgrade and support the platform. As a result, both Drupal 7 and 8 will continue to be maintained until November 2021. By that point Drupal 9 will be on version 9.2. Drupal has made itself dependent on the PHP Symfony framework, which does 2 year release cycles for major updates, which means Drupal 9 will be following this schedule.
As part of my tests I’ve noticed a few gaps in our base build that makes Drupal 9 not quite ready for us to begin developing new websites. We utilize Zurb Foundation as our mobile responsive framework. This is a great tool to build our front end code in, and much leaner and faster than Bootstrap. However, it is currently incompatible with Drupal 9. There is a patch that is working its way into the module that will allow it to be supported in Drupal 9, specifically in a composer based workflows. Until this has been remediated by the community, we will continue to start with Drupal 8 for new clients. That’s only one example, there are others, and it may vary depending on how your websites are set up, and what sorts of dependencies your sites may have.
What Do I Need to Know About Upgrading?
Drupal 9 has core dependencies it needs to run. These include the following:
- PHP 7.3 as a minimum version
- MySql 5.7
- Drush 10 (Drupal 9 will not work on lower versions)
- Symfony 4
You will want to connect with your hosting provider to understand if they support these dependencies. The major managed hosting platforms already do such as Pantheon, Acquia, and Platform. However, if you host your own websites on say AWS, Azure, Google Cloud, or on prem you may need to revisit them and update the environments. Additionally, if you’re on hosting services like HostGator, Digital Ocean, Linode, Lightsail or something similar they may not have updated these requirements so they will need to be reviewed.
For local development environments I have tested on a number of them and found the following:
- Drupal VM - no issues, update config.yml file
- Lando - no issues, just update to the latest version and update yml file
- Acquia Dev Desktop - no issues, just update to the latest version
- Docksal - no issues, just update to the latest version and update yml file
- MAMP/WAMP - no issues, just update to the latest version
- Brew stack / linux stack - Similar to hosting environments, these will just need to be updated to the latest versions
- Others - Check the websites of those projects to see where they are at
For your local environments it's also recommended that you install Drush local to each project, and not globally on the system. Another tip, around configuration management, are the config settings variables have changed and should reflect the following:
$settings['config_sync_directory'] = $app_root . '/../config/' . basename($site_path);
You can already update Drupal 8 projects with this, so it should be easy to transition your config. Finally if you develop on Windows, you may experience issues with working with Composer (the tool built on top of Symfony to manage dependencies). In those cases you may want to review your local development tools and move to something that may be a bit more scalable like Drupal VM or Docksal. Also make sure you’re running Windows 10’s latest version. Microsoft has made strides to support open source projects natively like Symfony or even NPM. If you’re still on Windows 7, you may want to address upgrading now because it is very difficult to develop open source applications on. Or rely on a virtualized environment using VirutalBox and install Linux or Docker in there.
When Does Support for Drupal 7 and 8 End?
Support for Drupal 7 and 8 ends in November 2021. Both are going to be retired at the same time. I’ll focus on Drupal 7 users since a lot of above is geared towards Drupal 8. Since Drupal 9 was built within Drupal 8’s framework, the upgrade path is much more seamless. The community is going to wait until 9.2 before introducing new features, so there will be time to transition into the CMS.
For Drupal 7, since the underlying framework is extremely different from Drupal 8, it will require much more work to move into Drupal 9. In most cases we would recommend redesigning the website. This is an opportunity to introduce a newer look and feel, a streamlined user experience, as well as leveraging the latest and greatest from Drupal.
However, I understand that budgets may not be there for this. If they can’t be allocated before November 2021, I’d recommend installing the upgrade status module noted above to see if the modules that are installed on your website are compatible with Drupal 9, or what the progress is around the upgrade process. From there your theme(s) will need to be ported into Twig, the templating engine for Drupal 8 and above. There are many articles out there around how to do this, just note this is quite a bit of an undertaking. While Drupal 7 will not stop working in 2021, there will no longer be security updates which means your website will be exposed to hackers and other bad actors on the internet. The majority of Drupal sites on the internet right now are running version 7, as seen in the reddish color below (As of the end of May 2020 source from Drupal.org).
This makes reviewing your websites that much more important because this will expose almost 1 million websites to hackers.
If you’re an existing client of Boston Digital, your account rep will be reaching out about this so that you’re aware. If you aren’t one of our existing clients but are interested in our services, please feel free to contact us at email@example.com and we can discuss your situation in more detail.