Drupal 7 Migration

My notes on migrating a Drupal 7 site to Drupal 9.

Prepare local copy of drupal7 site.

  1. Clone repo.
  2. Copy files directory and database from live site.
  3. Check private file system and tmp paths in configuration.
  4. Uninstall and remove all unnecessary and unused modules.
  5. Switch theme to Bartik. Configure block structure.
  6. Uninstall and remove unnecessary themes.
  7. Clear caches.

Install new blank drupal site.

  1. Create empty database and db user.
  2. Create new drupal site using composer:

    composer create-project drupal/recommended-project site-folder

  3. Fix file permissions to ensure the webserver has write permissions.
  4. Run install process.
  5. Delete Comment field from all content types then uninstall comment module.
  6. Install required modules (Antibot, Honeypot, EU Cookie Compliance).
  7. Install Olivero theme and apply patch to fix external links in menus
  8. Install local copy of drush using composer.
  9. Update database and rebuild cache.

Start Migration.

  1. Check migration modules are enabled on new drupal site.
  2. Navigate to /upgrade on new site and check required preparation steps.
  3. Put site into maintennce mode with:

    drush sset system.maintenance_mode 1 --input-format=integer

  4. Click on Continue to get to the next page.
  5. Enter source database details and full local path to source site (e.g. /var/www/site).
  6. Review modules that won't be migrated and then click to continue.

Fix configuration.

  1. Rebuild caches and update database.
  2. Dump database to fix file and image paths that should now point to sites/default not sites/site_name.
  3. Re-add views. Re-add menu items.
  4. Fix default date formats for Date Medium (date only) and Date Short (time only).
  5. Fix text formats in content types. Delete text formats no longer needed.
  6. Adjust account names and roles as required.
  7. Install new theme. Place blocks in required regions.
  8. Uninstall Migrate modules and delete migrate tables from database.