migration to drupal 10

How to upgrade Drupal 7 and Drupal 8 to Drupal 10

Drupal 10 was released in late 2022. The developers promised the new version to be safer and more convenient for the users, but you will not be able to prove this until you upgrade the old version of Drupal CMS that your website is currently running on.

In this guide, you will learn how to upgrade your site from Drupal 7 or Drupal 8 to Drupal 10.

*Important note: All recommendations in this post apply only if you are upgrading from Drupal 7 or 8 to Drupal 10. If your site is already running on Drupal 9, follow the instructions given in the Upgrade to Drupal 10 Twice as Fast post.

Migration to Drupal

Generally, migration is the process of moving data from one source to another. The source can be a database (DB) or files of CSV and XML types.

drupal migration

In the case of Drupal, there is a source database (Drupal 7 database) and the database to which this data must be transferred (Drupal 10 database). As you can see from the diagram, there are several operations you need to perform during this transfer.

  1. Data acquisition. A query system allows data to be retrieved from the source database.
  2. Mapping. At this stage, you need to define which field of the source base needs to be transferred to which field of the target base.
  3. Processing. This operation allows us to modify the data retrieved from the source database. For example, we may need to change the format of the data we receive so that it is in line with the new structures in Drupal 10.
  4. Setting. Setting is the task of the part of the target object that inserts the data into the structures of the Drupal 10 database.

Why move to Drupal 10?

  • Upgrading your Drupal version is critical to the site's security. Here is an example from ADCI Solutions’ experience: We were approached by the managers of a clinic that was planning to work with the government. To do so, they must pass the site security certification and the portal rate certification. This is impossible with a site running on an outdated CMS version that has a lot of vulnerabilities.
  • Newer versions of Drupal run on PHP 8 and higher. Later versions of PHP guarantee the speed and security of a resource — the two parameters the users will appreciate the most. Also, most hosters only support PHP 8 and higher.
  • The longer you wait to upgrade, the more difficult it will be to upgrade your site in the future. There is a gulf between Drupal 7 and other versions of the CMS, as version 7 has a completely different code base. You will have to do the site migration in any case, but it will be harder to find a specialist who can do the job.
  • The updated version of the system is more convenient for both developers and users. Professionals will find assistance with Drupal administration in the new front-end theme, Olivero, while content managers will find help in the new admin panel theme, Claro.
  • What the Drupal community is most active in developing are contrib modules for Drupal  9 and 10. This means that if you wait to upgrade, you will miss out on new features and modules incompatible with older versions.
  • And finally, the new version of the system always implies better performance of the resource and support for the latest web development standards, which means a stable and up-to-date basis for your project.

What are the benefits of Drupal 10?

Automatic updates of the core and modules

Developers no longer need to write special scripts to check the exit and install upgrades. Drupal 10 implements the ‘set up and forget’ principle, which simplifies maintenance and is suitable for people without programming experience. This functionality is especially useful for small projects with a limited number of dependencies.

CKEditor 5

Integrating the new version of the WYSIWYG editor, CKEditor, was one of the most difficult tasks for the core developers. Now administrators have a tool that looks a lot like the familiar Microsoft Word and Google Docs. A contextual balloon that pops up when you click on selected text or add an image now allows you to edit the content in real time.

Decoupled Menus

The functionality of Decoupled Menus allows the frontender to more easily transform these menus into navigation elements instead of hardcoding them. This also means that non-developers will be able to edit the menu.

Olivero Theme

The Olivero theme was introduced to Drupal 9.1 as an experimental theme and has since become an out-of-the-box front-end theme. The previous theme, Bartik, which had been in use since 2011, became antiquated and did not meet modern requirements. The Olivero brings about to the site a contemporary design, including improved typography, animation and color palette. Olivero is also more suitable for disabled people.

Starterkit Theme Generator

Developers of Drupal themes now have a stable Starterkit theme generator. Previously, each new theme had to be based on the Classy theme, inheriting its CSS classes and markup. Now the Starterkit will help developers save time. They will be able to use it to copy default themes into a new folder and inherit the CSS and HTML only from them. This will allow them to safely change the base theme without worrying about affecting the default themes.

How difficult is it to upgrade to Drupal 10?

Migrating from Drupal 7 to Drupal 10

drupal 7 to drupal 10 migration
Difficulty: 5 drops out of 5

Drupal 7 has a code base that is critically different from that of Drupal 8, 9, and 10, which is why it is the most difficult to migrate to the latest version. When Drupal 8 was created, the developers completely overhauled Drupal’s internal system: the Symfony components were integrated, and since then the release of new CMS versions has been tied to the framework's releases.

Why do you need to upgrade Drupal 7?

  • Drupal 7 is slow. D7 uses outdated versions of PHP that no longer provide the speed and security required of a modern resource.
  • If a site is built on D7, it means that it was created a long time ago and has accumulated some technical legacy. Migrating to another version of Drupal is a chance to get rid of this legacy.
  • Many contrib modules created for version 7 are no longer being developed. The main focus of the community is Drupal 9 and 10.
  • As the number of sites built on Drupal 7 decreases, so does the number of developers who can work with Drupal 7. Over time, it will become increasingly difficult for you to get support or help from the community.

Step-by-step guide to upgrading from Drupal 7 to Drupal 10

Since Drupal 7 has little in common with Drupal 8, 9, and 10 from a technical perspective, migrating to the ninth or tenth version means completely rebuilding the project. This is a good time to schedule a site redesign, get rid of the technical legacy, perform a resource audit, and review poorly built algorithms.

*Important note: Assess how many contrib modules are used on the site. Developers who support the modules may not have updated them to be compatible with D10. If they provide important functionality to the site and you are not ready to patch them, you can upgrade to D9, which has all the modules already ported. After that, upgrading to D10 will be easy.

Step 1. Backing up
Create a backup of the database using MySQL:

mysqldump -u yourusername -p yourdatabase > backup.sql

Also create a backup of the site files. You can run the `rsync` command from the command line, or simply copy the contents of the site root directory to another folder.

Step 2. Server and system preparation
– Make sure the server meets Drupal 10 requirements. For example, install PHP 8.1 or higher, enable PHP extensions like `mbstring`, `pdo`, `json` that you may need.
– Upgrade the Composer to the latest version:

composer self-update

Step 3. Checks of the main modules
You can check the availability of upgraded versions of modules running on Drupal 10 using the Upgrade Status module. It will also show if the module is due for an upgrade. Determine what functions you use the deprecated modules for and whether there are alternative modules that could replace them. 

Step 4. Creating a site on Drupal 10
Create a new site on the latest version of Drupal 10. Add the modules you selected in the previous step. You will also need to recreate the types of content, blocks, multimedia files, menu, etc. There is no point in copying every bit of the old site's architecture, as you now have the opportunity to improve the page structure and use new tools such as the Layout Builder.

Step 5. Custom module upgrade
We recommend minimizing the use of custom modules. Typically, upgrading them means rewriting the code and using new APIs provided by Drupal 10.

Step 6. Data migration
Conduct a thorough content audit before migration. Make sure you have created all the necessary structures to transfer the content to your new site (Step 4). If the site is small, you can transfer the data manually. For large sites, we recommend using automatic content migration.

Step 7. Theme update
At this stage, you can do a rebuild of the old theme, create your own theme from scratch based on a new design, or use a theme that has already been created and adapted for Drupal 10. 

Step 8. Debugging and troubleshooting
– Using Drush, you can get information about the status of the site, check if the necessary modules are enabled, etc. The drush status command prints out the most important information about the Drupal installation and its parameters.

– Drush allows you to view event logs and other logs that can help identify the issues. The drush watchdog-show command prints log entries on the screen.

Step 9. Testing
– Automated browser testing tools such as Selenium WebDriver or Cypress can help test the site interface in real browsers. You can set up test scenarios that mimic user actions such as mouse clicks, typing text, and reviewing page content.

– Verify site performance using load testing tools such as Apache JMeter or Gatling. This allows you to determine how the site responds to heavy load and assess its performance.

Step 10. Relocation to production server
– Once you are satisfied that everything is working correctly on the test server, move the site to the production server using tools such as `rsync` or `git`.

Migrating from Drupal 8 to Drupal 10

drupal 8 to drupal 10 migration
Difficulty: 3 drops out of 5

Support for D8 will end on November 30, 2021; updates to D9 will no longer be released after November 2023. This means that it is now, or will soon be, unsafe to use these versions of the system. But do not panic: it is relatively easy to migrate from version 8 to version 10.

Migration from Drupal 8 to Drupal 10 is a switch to a different version within the same code base, so it is not as difficult as dealing with D7. Even for a complex site, this is only a matter of a few weeks.

Step-by-step guide to upgrading from Drupal 8 to Drupal 10

*Important note: Assess how many contrib modules are used on the site. Their keepers may not have updated them to be compatible with D10. If they provide important functionality to the site and you are not ready to patch them, you can upgrade to D9, which has all the modules already ported. After that, upgrading to D10 will be easy.

Step 1. Backing up
Before starting the upgrade, make a full backup of your current site, including files and database. You can use such tools as phpMyAdmin to back up the database.

Step 2. Server and system preparation
– Make sure the server meets Drupal 10 requirements. Check your PHP version (PHP 8.1 or higher is recommended) and enable all necessary PHP extensions like `mbstring`, `pdo`, `json` and others.
– Upgrade the Composer to the latest version:

composer self-update

Step 3. Upgrade of Drupal Core
Upgrade the Drupal core to at least version 9.4 using Composer. In the root directory of the project run:

composer update "drupal/core-*" --with-all-dependencies

Step 4. Upgrading contrib modules and themes
You need to update all contrib modules and themes to Drupal 10 compatible versions while you are still using Drupal 9. You can perform the check using the Upgrade Status module.

Step 5. Custom code compatibility check
Check if custom modules and themes are compatible with Drupal 10 using the same Upgrade Status module. The module analyzes the code and provides recommendations for updating the code.

Step 6. Upgrade of Drupal Core
Edit the composer.json file and update the core version drupal/core-* to ^10.   

"require" : {   
"composer/installers" : "^2.0"   
"drupal/core-composer-scaffold" : "^10"    
"drupal/core-project-message" : "^10"    
"drupal/core-recommend" : "^10"

In addition to the components mentioned above, composer.json can also include the drupal/core-dev and drupal/core components. 

As soon as you run the composer update, the update will begin.

Step 7. Database update
drush updatedb

Step 8. Debugging and troubleshooting
– Using Drush, you can get information about the status of the site, check if the necessary modules are enabled, etc. The drush status command prints out the most important information about the Drupal installation and its parameters.

– Drush allows you to view event logs and other logs that can help identify the issues. The drush watchdog-show command prints log entries on the screen.

Step 9. Testing
– Automated browser testing tools such as Selenium WebDriver or Cypress can help test the site interface in real browsers. You can set up test scenarios that mimic user actions such as mouse clicks, typing text, and reviewing page content.

– Verify site performance using load testing tools such as Apache JMeter or Gatling. This allows you to determine how the site responds to heavy load and assess its performance.

Drupal 9 update to Drupal 10

drupal migration tools
Difficulty: 2 drops out of 5

The core of Drupal 10 itself has a cool built-in upgrade system that helps you move smoothly to the latest version of the system. In addition, version 10 offers a ready-made set of modules that can save a tremendous amount of developer time.

The move to the next version is not as difficult as the leap across several versions, which is why it is called an update, not a migration. You can find the detailed instructions in this guide: Guide to Quick Site Upgrade from Drupal 9 to Drupal 10.

Migrating a Drupal site with the help of a Drupal team

drupal website migration
Difficulty: 1 drop out of 5

None of the above upgrades will turn into a headache if it is not you doing the work, but a team consisting of Drupal developers, a project manager, and a tester.

Conclusion

Upgrading Drupal is like going to the doctor — tedious, but necessary for normal life. As the new version is prepared, the Drupal development team identifies new vulnerabilities and develops patches to fix them. The updated Drupal ensures that the site is compatible with the latest standards in web development, so that the site is displayed correctly on different devices and browsers. In addition, each upgrade of the system brings new features and improves site performance.

No one is likely to object to such an update. And while it looks more like a script for a movie about the future, upgrade your version of Drupal.

You might also like