Save time upgrading Drupal 9 to 10 with these tips

Upgrading ensures our sites and apps remain secure with security patches as needed. They will also continue to receive feature enhancements going forward.

Today I deployed the Drupal 10 upgrade for the SPREP Virtual Library. It was completed over a 3 week period while juggling the day-to-day support requests, meetings and providing technical advise.

In contrast, I later upgraded and deployed one of our smaller apps with no custom code in just 2 hours.

Upgrading from Drupal 9 to Drupal 10 involves a series of critical steps and considerations to ensure a smooth transition. This post looks at how to upgrade then outlines key lessons learned and best practices from the upgrade process, focusing on Drupal configurations, Docker environments, and CI/CD pipeline adjustments.


How do you upgrade? 

1. Start with installing the Upgrade Status module which will check if you are ready for an upgrade. 

2. Uninstall any deprecated core modules and themes

3. Reduce the clutter and remove any uninstalled modules

4. Upgrade contrib modules to a supported version

5. If you have custom modules and themes you will need to patch them too. Upgrade status can analyse your custom code and detect any deprecated calls. Using Drupal Rector you can automate the common fixes.

6. Upgrade your packages using composer and apply database updates.

7. Test that things are working correctly after the upgrade. 


Tips - What can we take away from this experience? 

1. Have CI tests before you start. This helps you test that the upgrade did not break exisiting functionality. 

2. Perform upgrades in a git branch. Commit regularly as you complete the steps above.

3. If a module blocks the upgrade, remove it temporarily. You can add it back once the upgrade completes.

4. Use config_split module to only activate Upgrade status module in local dev to save server resources

5. When using the docker4drupal setup, you need to use Nginx 1.25 or higher and set the host header to drupal10 or else styling and js will break.

6.  Upgrade breaks Gitlab CI shared pipelines as they dont have enough resouces for Selenium based tests 

7. Azure OpenID connect config must be updated

8. Record steps and/or commands that need to be run on the current website before you can switch to the upgraded one such as removing deprecated modules and themes

9. Test your upgrade in your dev and staging environments before prod (backup prod before you start)


Happy upgrading!

Comments

Popular posts from this blog

Insights for Software Development Workflows from the Pacific Islands

Tips for improving Drupal security

Cloud Development environments for LEMP stack using Android in Samoa