After the upgrade

Last updated on
31 May 2025

This documentation needs work. See "Help improve this page" in the sidebar.

Test your new site

When the upgrade is complete you should thoroughly test the new site.

Troubleshooting

First, see the Known issues when upgrading from Drupal 6 or 7 to Drupal 8 page.

Cleaning up, delete migration tables

The upgrade process creates database tables that can help with diagnosing and fixing problems. The tables can be deleted only when you are completely satisfied that the upgrade did not introduce problems. Once the tables are deleted it may not be possible to fix a problem.

See #2713327: Document ways to remove migration tables (ID map etc.) for different methods of deleting the migration tables.

A Drush command is being worked on in #2997576: Provide a drush wrapper to destroy/delete migration tables, but not ready yet, as of 16 January 2025.

Using an update hook (Code source xurizaemon on GitHub)

Only to be used after your migration has been completed, and the various migrate modules have been uninstalled. Taking a backup always advisable.

/**
 * Clean up Migrate tables
 */
function  hook_update_N() {
  $database = \Drupal::database();
  if ($migrate_tables = $database->schema()->findTables('migrate_%')) {
    foreach ($migrate_tables as $table) {
      $database->schema()->dropTable($table);
    }
  }
}

Using Drush and MySQL (same source as above)

Only to be used after your migration has been completed, and the various migrate modules have been uninstalled. Taking a backup always advisable.

This unfortunately only does one migrate_% table at a time; the "while do" doesn't work in this context. So maybe only useful for small migrations.

drush sql:query "show tables like 'migrate_%'" | while read TABLE ; do
  echo "Dropping $TABLE" && drush sql:query "DROP TABLE $TABLE"
done

Clean up orphaned blocks from a deleted theme

Leftover configuration objects, for example an uninstalled theme's leftover blocks, can jam the configuration system, when you try to import it on production, resulting in an error:

Configuration block.block.bluemarine_user_login depends on the bluemarine theme that will not be installed after import.

These configuration items can be deleted in a few ways, see Single item import fails with validation errors from other config.

To Do: Add actual solutions here, and not just link to issues.

Help improve this page

Page status: Needs work

You can: