Main navigation

Tech Talk: Upgrading from Drupal 8 to Drupal 9

Drupal 9 Upgrade Logo
Some lessons I learned along the way.
Zeifer | August 12, 2020 Technology

A month ago I began the process of doing the upgrade to this site from Drupal 8 to Drupal 9. While I knew that there would be some challenges in doing so, those challenges were not as hard-hitting nor did it stop me from doing so.

Because my custom profile is built upon Acquia's Lightning profile, I had to make sure that Lightning was also upgraded to version 5.x. And, because the whole project is composer-built, there had to be some additional checks and dependency upgrades that caused some stalling. It wasn't Lightning itself, nor was is it Drupal core (though, when reading the log files, it was very hard to not get that idea, as the composer errors would list the possible valid packages from Drupal core, but it wasn't Drupal core that was the problem), but it was some of the other contributed modules that haven't been set to use an updated version number. That was the first major hurdle I had.

Once that was completed, the next major hurdle was running the database updates. Nothing on this site is very "outside the Drupal box", but the problem is that I wasn't just one version behind, but multiple versions. So it was having to process through all of the updates from multiple updates was a little tough. The core updates didn't have much problems, but some of the contrib updates were having problems. I was able to resolve this by first updating first to the latest version of Drupal 8.x, doing the database updates there, then updating to Drupal 9.

After the updates were finally completed, I went through and had to check / verify everything was working as before. The one item that had a problem was a view I had made for the blog. There was a reference field within the view that was coming from a contrib module that, when it was updated to be Drupal 9 compliant, it wasn't, so it was causing a fatal error. Thankfully, I was able to create a patch for it and have it resolved for the Drupal community.

All in all, the whole upgrade process from beginning to end took about a day to do, and about 3 days of testing to verify that there were no lingering problems. Thankfully, there wasn't any. With the upgrade to Drupal 9, I have seen some performance improvement, which is always good. As a developer, it is still a little too early to tell whether the removal of a lot of deprecated code is going to be a challenge or not. But looking through a lot of what has been done through the community and the developers updating their contributed modules to be Drupal 9 ready, I feel that moving forward it's going to be more of a re-learning / updating my personal techniques, as well as helping out and updating any documentation out there with the new, more modern methods that Drupal 9 is embracing.