3 software engineers reviewing a software upgrade plan

Can I Upgrade from Drupal 9 to Drupal 11?

It was announced on X on 12th July 2024 that the first stable release of Drupal v.11 is to be made available "the week of 29 July 2024".

https://x.com/drupal/status/1811823477290131919

Should you stampede to upgrade your Drupal v.8/9/10 website to v.11?

Generally speaking, no. Indeed, for most Drupal sites that aren't small and simple, we recommend waiting at least 6-12 months after the first stable release of a new major core version before upgrading to it. This gives plenty of time for:

1. The core to become fully battle-tested.
2. Most, if not all, the popular modules to be fully compatible with (i.e. upgraded to) the latest core.

Upgrading your Drupal website from version 9 to 11 involves several critical steps. This process requires moving first to Drupal 10 before proceeding to Drupal 11. While this upgrade path may seem straightforward, it involves significant technical complexity to ensure all aspects of your site function correctly after the transition. This article aims to guide you through the essential high-level steps, helping non-technical stakeholders appreciate the intricacies involved.

Why Can't You Upgrade Directly to Drupal 11 from lower major versions, e.g. Drupal 9 or Drupal 8?

Drupal's development philosophy includes substantial changes and improvements between major versions. These changes often introduce new features, deprecate old ones, and modify core functionalities. Therefore, skipping intermediate versions can result in compatibility issues and broken functionalities. Each major version upgrade prepares the site for the next one by resolving deprecated code and updating dependencies incrementally.

Step 1: Preparing for the Upgrade

1.1 Backup Your Site

  • Before making any changes, backup your entire site, including the database and all files. This step is crucial to prevent data loss and allows you to revert if something goes wrong.

1.2 Review Release Notes and Documentation

  • Familiarize yourself with the changes in Drupal 10 and 11 by reviewing the release notes and upgrade documentation.

Step 2: Upgrading from Drupal 9 to Drupal 10

2.1 Update to the Latest Drupal 9 Version

  • Ensure your site is running the latest minor version of Drupal 9. This step often involves running Composer commands to update your core and dependencies.

2.2 Check Module and Theme Compatibility

  • Use the Upgrade Status module to check which of your installed modules and themes are compatible with Drupal 10. This tool helps identify deprecated code and necessary updates.

composer require drupal/upgrade_status

drush en upgrade_status

2.3 Update PHP and Other Dependencies

  • Drupal 10 requires PHP 8.1 or higher. Ensure your server environment meets this requirement and update your PHP version if necessary.

2.4 Resolve Deprecated Code

  • Use tools like Drupal Rector to automatically refactor deprecated code. This step is essential for ensuring your custom modules and themes are compatible with Drupal 10.

composer require drupal/rector

drush rector:process

2.5 Perform the Upgrade

  • Run Composer commands to upgrade Drupal core to version 10. This step involves updating your composer.json file and executing the update commands.

composer require drupal/core-recommended:^10 drupal/core-composer-scaffold:^10 drupal/core-project-message:^10 --update-with-dependencies

  • Clear caches and run database updates.

drush cache:rebuild

drush updatedb

Step 3: Upgrading from Drupal 10 to Drupal 11

3.1 Update to the Latest Drupal 10 Version

  • Ensure your site is running the latest minor version of Drupal 10, similar to the previous upgrade step.

3.2 Re-check Module and Theme Compatibility

  • Use the Upgrade Status module again to verify that all modules and themes are ready for Drupal 11.

3.3 Prepare for New Requirements

  • Check the Drupal 11 requirements and ensure your environment supports them. Drupal 11 may have additional requirements or deprecations not present in Drupal 10.

3.4 Perform the Upgrade to Drupal 11

  • Update your composer.json file and run the Composer command to upgrade to Drupal 11.

composer require drupal/core-recommended:^11 drupal/core-composer-scaffold:^11 drupal/core-project-message:^11 --update-with-dependencies

  • Clear caches and run database updates again.

drush cache:rebuild

drush updatedb

Step 4: Post-Upgrade Tasks

4.1 Testing

  • Thoroughly test your site to ensure all functionalities work as expected. Pay special attention to custom modules, themes, and integrations.

4.2 Monitor Logs

  • Check your site's logs for any errors or warnings that might indicate issues stemming from the upgrade.

4.3 Update Documentation

  • Document any changes made during the upgrade process, including new module versions, updated dependencies, and resolved issues.

Conclusion

Upgrading from Drupal 9 to Drupal 11 involves a two-step process, first upgrading to Drupal 10 and then to Drupal 11. Each step requires careful planning and execution to ensure a smooth transition. While the process involves significant technical complexity, tools like Upgrade Status and Drupal Rector can help streamline the process by identifying and resolving deprecated code and compatibility issues. By following these steps, you can ensure your Drupal site remains secure, up-to-date, and ready to take advantage of the latest features and improvements.

For more detailed instructions, refer to the Drupal documentation and consult with a Drupal expert if necessary.

https://www.drupal.org/docs/upgrading-drupal

Meet The Author

Written By
ross
Published date : Jul 23, 2024
Last updated : Jul 23, 2024