Migrate your content and configurations from drupal7 to drupal10
Introduction
Migrating from Drupal 7 to Drupal 10 is a crucial step for websites that are still using this older version. This upgrade is important for several reasons:
- Security: Drupal 7 will soon no longer benefit from security updates, leaving sites vulnerable to attacks.
- Features: Drupal 10 offers new features and a better user experience.
- Performance: Drupal 10 is faster and optimized for modern technologies.
- Maintenance: It is easier to maintain and develop sites on the latest version of Drupal thanks to improvements made to the CMS architecture.
To migrate, your options are as follows:
In this guide, we will cover two migration methods:
- The classic way provided by Drupal, which is a standard and recognized approach.
- The method developed by Habeuk, which offers more maneuverability and control to the user thanks to specific modules.
Classic migration method
To perform a classic migration, it is recommended to use Drupal contrib modules such as migrate
, migrate_tools
, migrate_plus
, and migrate_upgrade
. Here are the main steps:
- Export Configurations: Use the
migrate
modules to export your Drupal 7 site configurations. - Import Configurations: Import these configurations into your new Drupal 10 site.
- Reference sources: For more details, see the official Drupal documentation.
Limitations of the classical method
The classic migration method can sometimes lead to data loss, including entities and their instances. To overcome these limitations, Habeuk has developed a more controlled and secure process, organized around two specific modules.
Using Habeuk Modules
Once the basic configurations are imported using Drupal contrib modules (migrate_tools
, migrate_plus
, migrate_upgrade
), follow the steps below to use Habeuk modules:
Installing modules
Install the following modules:
- Drupal 7: Install the migrateexport module
- Drupal 10: Install the migration_hbk_auto module
Commands :
- For Drupal 7:
composer require drupal/migrateexport
drush en migrateexport
- For Drupal 10:
composer require drupal/migration_hbk_auto
drush en migration_hbk_auto
Importing entities
Go to the entity import page: /admin/migration-hbk-auto/import-from-d7
- Click the "load all entities" button to load the different entities of your Drupal 7 site.
- The entities will be displayed as an accordion list.
- Expand the entity you want to process and click "List bundles" to get the list of bundles related to this entity.
- Expand the bundle you want to process. Click "check configuration" to check if all configurations related to this bundle are present.
A mini-report will be given to you with:
- The number of contents to import
- Fields on the Drupal 7 side
- Fields on the Drupal 10 side
(If any fields are missing, they will be displayed in red on the Drupal 7 side and "missing" on the Drupal 10 side.)
Re-importing fields
If any fields are missing or you want to re-import the fields, click the "Re-import all fields" button.
Importing entities
Fill out the form at the bottom left with the following information:
- pagination length: Defines how many contents will be imported per query.
- pagination start: Defines at which "page" the import should start.
- continue: Sets whether the import process should stop on error.
Click on the "Import contents" button to start importing the contents.
In anticipation of cases where you may need to re-import only some of your content instances (you have made changes that you do not want to lose in most of the already imported instances), Content Import Management has been made available to you and is used as follows:
- Click on the button in question
- A popup is displayed in which you can find the list of instances of your entity that you can manage. Once you have found the instance you want to recover, you just have to click on the button in the action column to import it
Once all the configurations and instances of your entities are imported, all you have to do is set up your theme and finalize your Drupal 10 site. Congratulations, you've done it!