Skip to main content

What do you need to upgrade to Drupal 9

2021-01-12

The official Drupal 9 has released. The end of life for Drupal 7 has been extended to November 2022, but Drupal 8 end of life remains to be November 2021. The good news is that upgrading to Drupal 9 from Drupal 8 is a much smoother process than upgrading Drupal 7 to Drupal 8. If you are thinking about upgrading your website to Drupal 9, this article is for you.

Why should I upgrade?

Unlike when Drupal 6 reached its end of life, once Drupal 7 and Drupal 8 hit their end of life, there will be no Long Term Support program. Which means no more security patches will be released. Therefore when new vulnerabilities are introduced, your data and your customers’ information might be at risk. This also means that new features are unlikely to be developed to work with Drupal 7 or 8, making it harder to add new features to your existing website.

On top of that, Drupal 9 with the newer version of PHP and clearing outdated code, has much better security and performance. It is also more open to integrating with third-party applications and different devices. Drupal 9 also focuses on the editorial experience for users, making it easier and better for content editors to make updates to the website.

When should I upgrade?

The short answer is you should start now because the initial release of Drupal 9 did not introduce new features, this means that unlike other major releases before, you don’t need to “wait for a while to see if there are bugs to fix”.

The long answer is it is different for every website, it depends on the size, features, codebase and modules of your website. There are some requirements for your current website in order to be able to upgrade to Drupal 9. We will get into more details below. One good indication is If all the Drupal modules on your website are compatible with Drupal 9, it is probably a good time to start working on the upgrade. In fact, many contrib modules already have updated to be compatible with Drupal 9

What are the steps to upgrade?

Upgrading from Drupal 8 to Drupal 9 is significantly easier than upgrading from Drupal 7 to Drupal 8. That being said, there are still a few things you should prepare before doing so. Here are some of the steps to ensure a smooth upgrade.

Things to update first

 

Before we dive into Drupal 9, there are a few things we should update first. Updating Drupal core to 8.8 or 8.9 helps make going to Drupal 9 smoother. It also lets you look at the modules of your website and see if they are Drupal 9 compatible. With bugfixes and database optimizations, even if you are not going to update to Drupal 9 anytime soon, updating your website to the newest release of Drupal 8 is still beneficial to your website.

You might need to upgrade your PHP version. Drupal 9 requires a minimum of PHP 7.3 while Drupal 8 recommends but does not require it. Another element to update before you can jump into Drupal 9 is if you use Drush, you also need to make sure that you are on Drush 10 for it to be compatible with Drupal 9. As for the database side of things, you can check if your environment is compatible with Drupal 9

Deprecated code

Typically, code becomes deprecated because there are newer and better ways instead. In order to upgrade to Drupal 9, there is some deprecated code that needs to be updated. While some might require more effort to refactor, many are a simple matter of search-and-repace. If your website doesn’t use any of the deprecated code, then you are good to go. However, this means that if some of your modules still use deprecated code, you either have to wait for them to be updated, or search for an alternative before you can upgrade to Drupal 9.

Not sure if you are using deprecated code on your website? Not to worry, there are tools to help you. You can use an IDE or code editor that understands deprecation. For example, PHPstorm can inform you if you have deprecated code in your codebase and let you know what you should use instead. Another way to check is to run a deprecation test such as Drupal Check or Drupal 8 branch of Upgrade Status. These features or services can generate a report on your website to let you know if the modules on your website are ready to go.

Are all modules Drupal 9 compatible?

Once you have replaced or removed the deprecated code from your codebase, the chances are the custom modules are compatible. As for contributed modules, if they are not compatible with Drupal 9, you can wait for future releases or you can work with the module maintainers to offer help. If the modules on your website are no longer being maintained, you might have to find an alternative or update them yourself.

Once you check off all the steps above, you are ready to upgrade your website to Drupal 9.

Drupal 7

If your website is still on Drupal 7, the process of upgrading it to Drupal 9 is a little different. The good news is Drupal 7 support due to the pandemic, will be extended for another year to November of 2022, so you have more time to prepare and work on it. The most common way to do so is to upgrade your website to Drupal 8 first. Then follow the steps above to get your website ready for Drupal 9.

There are a few things to take into account with a Drupal 8 migration coming from Drupal 7. Click here to learn more about how to upgrade your website from Drupal 7 to Drupal 8.

If you have a Drupal 7 or 8 website and would like to upgrade it to Drupal 9, please don’t hesitate to ask us any questions. We are more than happy to help.