Guide To Migrate From Drupal 7 To Drupal 9

Do you need assistance to migrate your website from Drupal 7 to Drupal 9? Don’t worry! We at Alberta Tech Works are describing a step-by-step guide for your ease. But first, let’s find out what Drupal 9 is! 

What is Drupal 9?

Drupal 9 was released in June’2020 and is built with an API-first development approach.

After Drupal 7, many changes have been made to the platform. It’s code has been rewritten from scratch as per the latest technology trends.

Drupal 9, is very similar to Drupal 8.9 – editors, site builders, and developers, but has cleaned up from deprecated code – most of jQuery from UI, equipped with the latest libraries, revised third-party dependencies – Twig 1 and Symphony 3, and headed for future long-term growth.

 

Figure 1: https://www.drupal.org/docs/understanding-drupal/drupal-9-resources

Why should you upgrade to Drupal 9?

Adopting Drupal for your website isn’t enough; you must upgrade to the latest platform version to keep your website up-to-date. With the Drupal 9 release, both Drupal 7 and Drupal 8 have reached their end of life. Both D7 and D8  will no longer receive support & fixes from the Drupal community. 

With an upgrade, you will feel confident in its ROI. Moreover, with continuous innovating technologies, upgrading to Drupal 9 will offer more security and smoother functionality. In simpler terms, upgrading to Drupal 9 will update your CMS, fix problems you’re dealing with the previous version, especially addressing critical security issues, and add new innovative features. 

Here are some of the updates and modules being introduced in Drupal 9.

  • Deploy config between environments with Configuration management 
  • Updated Drupal’s default markup to meet HTML 5 standards like new semantic elements
  • Mobile centric experience on a mobile device
  • Mobile-first UI that allows you to make changes from a mobile device
  • Extended security coverage
  • PHP template with latest, simpler, secure, and faster theme engine
  • Incorporated multi-lingual capabilities
  • Improved content editor experience via a mobile-friendly toolbar, WYSIWYG editing, and in-place editing
  • Built-in JSON API for fully decoupled applications

How to prepare for the Drupal 8 to Drupal 9 upgrade?

Now you know the reasons to upgrade your platform, here are a few things that need to be taken care of for quicker updates: 

  • Make sure your site is in Drupal 8.9. Versions beyond Drupal 8.8 do not support Drupal 9 upgrades. For Drupal 8 users, upgrading to Drupal 9 is straightforward. 
  • Your site should be updated to the newest PHP version (PHP 7.3 or higher), MySQL 5.7 version (at least), MariaDB 10.2 (at least), PostgreSQL (to 9.6), and SQLite (to 3.26). And, if you’re using Drush, it should be Drush 10.
  • Deprecate your website code and fix it with Upgrade Status module.
  • Find out whether your site is based on Tarballs or Composer or tarballs to decide which actual upgrade flow will work for you. 
  • Finally, make sure that contributed modules are up-to-date. 

You can also use Acquia’s Drupal 9 Deprecation Status page to quickly search for the Drupal 9 readiness status of contributed modules and find related issues and patches.

Upgrade Tools

Make sure to use the latest contributed modules versions. For this, you can install and enable the Upgrade Status module. You can either use it on the Drupal back end or the command line with Drush. Now, analyze your contributed modules for the use of deprecated code and compatibility issues. 

  • If your contributed project is not yet Drupal 9 compatible, you can update the project on your site by the Lenient Composer Endpoint
  • If uncommitted patches are already available for your contributed project, you can use cweagans/composer-patches to apply patches where necessary. 
  • Now, use Upgrade Status to analyze your custom modules and themes. 

Fix all issues you find by using these tools to get a code compatible with both Drupal 8 and Drupal 9. Rather than starting the code updates manually, we recommend using Drupal Rector to generate fixes that address compatibility issues. The Drupal Rector will cover the most common deprecated APIs, and the rest of the issues identified by Upgrade Status would need to be fixed manually. The modules will provide directions to documentation about the changes.

At this point, your environment is suitable for Drupal 9, and all contributed projects have been updated to Drupal 9 compatible versions. Your custom modules and themes have also been updated to be Drupal 9 compatible. However, you still have a fully operational Drupal 8 site you could run as it is. The final step is to update the Drupal core itself to Drupal 9 and run update.php. Once you run the update, your site completely switches to the latest version of Drupal. 

Drupal 7 to Drupal 9 Migration

It will require a rebuild. However, you can use a list of tools and modules to get the code in place and avoid migration challenges. 

If you’re ready for Drupal 7 to Drupal 9 upgrade, here is a list of tools and modules that you’ll need during the migration process: 

  • Core Migrate Module Suite to migrate your content and site configuration.   
  • Upgrade Status Module to get information about contributed projects whether you’ve Drupal 8/9 versions or replacements. 
  • Upgrade Rector to automate module updates for Drupal 8 sites of common deprecated code to the latest Drupal 9 compatible code
  • Drupal Module Upgrader to generate changes for custom code, enabling 8/9 compatibility. 

And if you can’t upgrade to Drupal 9 on your own and need longer-term support for your Drupal website, contact Alberta Tech Works Drupal development team today!