How to Migrate Drupal 7 to Drupal 11 with Modules? Guide
The end of Drupal 7 support is approaching (January 5, 2025), which means this system’s users need to migrate to a newer version. This article explains how to move smoothly from Drupal 7 to Drupal 11, the key steps, and what to pay attention to. I encourage you to read the article or watch the video in the “Nowoczesny Drupal” series.
Why is it necessary to migrate Drupal 7?
Support for Drupal 7 will end in early 2025, translating into a lack of security updates and bug fixes. Staying with this version of the system may generate vulnerability risks and compatibility issues for companies and organizations. Migrating to Drupal 11 doesn't have to be complicated or expensive. It's a necessity and an excellent opportunity to upgrade your website and take advantage of the system's new features.
Preparing for content migration
Before we migrate, there are a few steps to take that will prepare our website for an easy and seamless move to Drupal 11.
1. Analysis of the current website
To begin with, it’s worth identifying what elements of the web page will need to be migrated.
For this tutorial, I prepared the website on Drupal 7 and used the Devel Generate module to generate the content we’ll migrate later in the text. And so we have:
- Content types (e.g., article, simple page).
- Custom fields (e.g., hero banner type paragraph with images, links, and descriptions).
- Users and data.
2. Preparing the development environment
The next step is to prepare the environment in which we migrate our content. We take the following steps:
- We install a clean version of Drupal 11 on a local development environment. We’ll find tools such as DDEV useful.
- We enable the modules required for migration: Migrate, Migrate Drupal, Migrate Drupal UI, which are in the Drupal core.
- We prepare the database from Drupal 7 and configure the connection in the settings.php file.
Performing a website migration
When the development environment and source data are ready, we can proceed to run the migration.
1. Module configuration for migration
Once Drupal 11 is up and running and the migration modules are activated:
- We go to migration settings,
- We select the source (Drupal 6 or 7),
- Set "source connection" to migrate,
- we define the path to Drupal 7 - /var/www/drupal7/docroot - that is, the connection to the source database.
2. Content migration
- After entering the source data, the system will automatically identify the modules and content types to be migrated.
- In the list, we’ll see which modules will be migrated correctly and which may require additional configuration (e.g., Paragraphs modules).
After starting the migration process, we check the effects:
- Whether all content has been transferred correctly,
- Whether user data, files, and media are available on the new system.
What to keep in mind when migrating a website to Drupal 11?
When migrating a website, in addition to the content, we should also pay attention to other aspects of the web page that won’t be migrated and may require additional work.
1. Website look
Migration moves content, but not styles. The new look has to be adapted to Drupal 11, which may require programmer's work, especially for complex graphic designs.
2. Custom modules
If you use custom modules, their code may need to be adapted to the new version of Drupal's API. This task can be time-consuming, depending on the complexity of the module.
3. Replace obsolete functions
Some features known from Drupal 7, such as PHP in blocks or SQL queries in templates, are no longer supported in Drupal 11. These elements need to be adapted or replaced with modern solutions.
4. Compatibility of contrib modules
Not all modules available in Drupal 7 have been upgraded to Drupal 11. It's a good idea to check that key modules are compatible before migrating to avoid problems after the process.
Benefits of migrating to Drupal 11
Migrating to Drupal 11 not only solves the problem of the end of support but also opens access to modern features such as:
- media field support, allowing better file management,
- a modern Twig-based template system,
- increased efficiency and safety.
Migrate Drupal with modules - summary
Migrating from Drupal 7 to Drupal 11 can be a challenge, but the migration tools provided by Drupal make the process simple and intuitive. Proper preparation is key: analyzing the current website, testing the migration on a local environment, and adjusting modules and design.
If your web page doesn’t contain complex features or an elaborate frontend, the process should be neither time-consuming nor costly. For more complex projects, it's worth consulting our experts, who can help estimate the scope of work and advise on how best to migrate Drupal 7 to the latest version.