What does it take to upgrade from Drupal 7 to Drupal 9?

  • 7 minute read

Moving from Drupal Core 7 to Drupal Core 9/10 takes several steps. Breaking down these steps into phases to upgrade a Drupal application is crucial for long term success. 

Drupal upgrades can be split into the following phases: 

 

  • Future Planning / Architecture review:

    Evaluate your Drupal application for readiness to update to the latest version of  Drupal core. This review should start with a current state review and work with your team to determine areas to improve editorial efficiencies, reduce technical debt, and modernize your frontend framework. 
     

  • Content migration:

    Drupal 7 Applications require content migration. If you have a D7 application on the Acquia platform. Utilize Acquia's Acquia Migrate Accelerate to migrate all of your content into your new latest version of Drupal Core environment. This will not affect your currently live Drupal site. While your team conducts user acceptance testing on the migrated content, continue development.

  • Deprecated Code Clean up / PHP Upgrade: 

    Drupal 9/10 requires ^PHP 8.x. Over the course of 10 years the PHP code from D7 to D9 has changed quite a lot. Use tools like to review what code needs to be updated. Other important code updates that require time and consideration:

    • Drupal Core version 

    • Current PHP Version - Upgrading deprecated PHP code takes time 

    • Total Number of Multi-sites

    • Database Size (in GB)

    • Number of Contributed Modules

    • Number of Custom Modules

    • Number of Views - Views must be upgraded manually

    • Number of Themes - Themes must be upgraded manually 

    • Number of PHP theme templates - templates must be rewritten manually 

    • PHP Text Format enabled

    • Organic Groups Module - Organic groups must be rewritten manually 

    • Rules Module - Rules do not have a 1:1 equivalent so you must manually audit your rules

    • Panels Module - Panels must be rewritten in Drupal 9/10 manually 

  • Frontend Theme Rebuild:

    Drupal 9’s frontend framework provides a modern approach to design. This requires more time to rebuild templates and other frontend components or code with a frontend developer. There are no tools to automatically do the frontend part of the upgrade.
    • Option one: Theme rebuild using TWIG 
    • Option two: Site Studio Rebuild 
    • Option three: Decoupled Frontend architecture 
       
  • Prelaunch Checklist:

    Review Acquia's prelaunch checklist and consider hiring Professional Services to perform security and performance audit known as  Launch Readiness.
     
  • Production Launch:

    Launch your new Drupal 9 site to the public with either a code deployment or a DNS change to your new D9/10 environment. 
     
  • Ongoing Development and Future Security Updates with DevOps:

    Once you have an upgraded site have you considered trying to automate your devops to keep up with security updates in the future?  The world's only full stack Drupal platform for development. Code Studio makes building Drupal applications easy. Accelerate your production with a complete set of tools that enable your teams to plan, build, test, review, and deploy from a single, customizable workflow parts of Drupal development so you can stay focused on what's most valuable.
    • Auto Devops: Automatically build, test and deploy your Drupal applications with Acquia Code Studio managed CI pipelines. Your Drupal application will inherit Acquia’s configurable build pipeline, which will install dependencies, scan and test your code, create a review environment, and (when you’re ready) deploy straight to production.
    • Automatic Updates: Code Studio will automatically update your Composer packages, replace deprecated custom code, and submit those changes for you to review in a Merge Request with a dedicated review environment. When you’re ready, you can merge the changes with a single button click and our pipeline.
    • Try Code Studio yourself with a clickable walkthrough  

 

What can you do right now?

One: D7 customers can request a Flight Path report from your Account Manager 
The Acquia Migrate D9 Flight Path Assessment is an automated report that will analyze your D7 current application’s readiness to upgrade to the latest version of Drupal core. The flight path report helps you identify key upgrades and migration scope by ​​taking stock of your content, data, frontend displays and modular functionality. Learn more about flight path from the WEBINAR STEP ONE TOWARDS YOUR MIGRATION TO DRUPAL 9: FREE FLIGHT PATH ASSESSMENT webinar.

Two: Install Upgrade Status 
Upgrade Status is a Drupal module that can provide more information about your current place and support for upgrading to Drupal 9

Three: Audit content and text formats 
Review your content types and text formats. It is recommended that you do not use PHP or code inside of your fields. If you are using PHP code inside of your database fields you should consider removing it before or flagging it before an upgrade to remove afterwards. 

Four: Audit views
Consider reducing views you don’t need and take a look at the Views migration from Drupal 7 to Drupal 9 module to help migrate. Some views might need to be rebuilt by hand. 

Five: Review custom code and features for PHP Compatibility
Custom modules and features need to be reviewed for PHP compatibility. You can use a code sniffer like https://github.com/PHPCompatibility/PHPCompatibility to identify code that has been deprecated and needs to be updated. There is also  Drupal 7 to 8/9 Module Upgrader can help to automate some of this task, but manual intervention will still be required.

Six: Upgrade everything to the latest version of D7 projects and review known upgrade issues. You can check the known upgrade issue page

Seven: Review frontend and page building elements.
Drupal 9 uses twig templates instead of PHP templates. You will need to manually rebuild your theme templates and functions after the migration.