Subscribe To Our NewsLetter
Share This Post:
We know that Drupal 7 reaching the end of life on January 5, 2023. It means it will no longer receive security updates or support from the Drupal community. So organizations or individuals that use Drupal 7 should upgrade to the latest version of Drupal 10.
What are Drupal migrations?
In Drupal migrations content, data, and configurations are transferred from one Drupal site to another. Migrations are commonly used when we upgrade from Older versions of Drupal to newer versions of Drupal.
Steps Taken Before Starting The Migration
Here's a concise list of steps to take before starting a migration
Step 1: Drupal 7 Database
First, back up the database of the Drupal 7 site. This ensures that if any issues are encountered during the migration, you can restore the site and re-run the process.
Using below command
Export: mysqldump -u root -p database name > filename.sql
Step 2: Review Configurations and Modules of Drupal 7
Review the configurations and modules of the Drupal 7 site and create a list of modules and themes available in Drupal 10.
Step 3: Drupal 10 Compatibility
- Check the availability of all the modules are themes that are in Drupal 7 should be also available in Drupal 10.
- Determine if any custom modules or themes will need to be updated or replaced for compatibility with Drupal 10
Comprehensive Migration Steps
Here's a detailed outline of the migration steps:
1. Set Up a New Drupal 10 Site
Create a new Drupal 10 site using Composer.
Using below command
composer create-project drupal/recommended-project my_site_name
Replace my_site_name with the desired name of your new Drupal 10 site.
2. Modules required for migrations
a. Migrate Plus
Migrate Plus provides additional features and extensions for the Drupal migration framework, such as source plugins and process plugins.
b. Migrate Tools
Migrate Tools offers Drush commands and a user interface for managing migrations, running migrations, and viewing migration status.
c. Migrate
The core Migrate module provides the base migration framework and APIs for migrating content and configuration from external sources to Drupal.
d. Migrate Drupal
Migrate Drupal offers migration support for importing content and configuration from previous versions of Drupal (e.g., Drupal 6, 7) into Drupal 10.
e. Migrate Drupal UI
Migrate Drupal UI provides a user interface for configuring and running Drupal-to-Drupal migrations using the Migrate Drupal module
Additional Migration Steps
Here's a list of additional steps for migration
a. Install Required Modules in Drupal 10
After setting up your Drupal 10 site, install the above-listed modules mentioned in the 2-step using Composer or by downloading and enabling them via the Drupal admin interface.
b. Install Drush Module for Migrations
Install Drush if not already installed, and ensure that you have the Drush Migrate module installed. Drush provides command-line tools for managing Drupal sites, including running migrations.
c. Multilingual Sites
If your Drupal site is multilingual, enable the necessary translation modules from the Extend page, such as Language, Content Translation, and Configuration Translation. Configure these modules as needed for your site's language requirements.
3. Connecting Drupal 7 database for migrations
1 Update settings.php in Drupal 10
Open your Drupal 10 site's settings.php file
Add the Drupal 7 database connection details with the migrate key. The structure should resemble the following:
2. Generate Migrations using Drush
Run the following Drush command to generate migrations:
drush migrate:upgrade --legacy-db-key migrate --legacy-root=/var/www/yourdrupal10site --configure-only command on drupal.
Configurations for Specific Migration
1. drush migrate
upgrade --legacy-db-key=migrate --legacy-root=https://yourdrupal10site --configure-only.
2. Check Migration Status
After running the migrate: upgrade command, check the migration status using drush migrate: status
3. Choose Migration Options
Decide whether to migrate all content at once or individual migrations based on site complexity
For complex sites with many customizations, consider choosing individual migrations.
4. Run Migrations
To migrate all content, use:
Migrate all command: drush migrate: import --all
For individual migrations, use:
Individual migration command: drush migrate: import <migration name>
5. Check Migration Status
Run the command drush migrate: status
6. Rollback Migrations
drush migrate rollback --all
Steps For Migration Execution
Here are the steps for migration execution:
Migration Status Checking
check your migration status using the migration status command.
Error Handling
Be prepared to handle errors that occur during the migration process.
Take the help of the Drupal community and Drupal documentation to handle these issues.
Post-Migration Testing
After completing your migrations, thoroughly check the functionality of all site pages. Ensure all links are working and images are displaying correctly on both the site and admin pages. Also, run update.php.
Custom code
Sometimes you need to write code for custom modules and themes that you need in Drupal 9 from Drupal 7. So you need to upgrade your code manually.
Let’s Wrap It Up!
In conclusion, drupal 7 to 10 migration is a process that requires careful planning, execution, and testing. By following the steps explained in the guide above you can successfully migrate your site from drupal 7 to its latest version.
If you require further assistance, don't hesitate to consult our Drupal Team. We will be more than happy to utilize our expertise to migrate your old Drupal website to the latest versions.
Share This Post:
Author Information
LN Webworks
Your Drupal Solution PartnerLN Webworks have championed open-source technologies for nearly a decade, bringing advanced engineering capabilities and agile practices to some of the biggest names across media, entertainment, education, travel, hospitality, telecommunications and other industries.