Dropping all “migrate” database tables after Drupal 8 migration (from Drupal 6)

FWIW, it appears that you can drop all of the “migrate” database tables that end up in your Drupal 8 database after a migration, such as migrating from Drupal 6 to Drupal 8. I ended up with 178 of these migration tables in my Drupal 8 database, and deleted them like this:

SET FOREIGN_KEY_CHECKS = 0;
drop table migrate_map_572fc072df61d;
drop table migrate_map_572fc0731606b;
drop table migrate_map_572fc07322bd1;
drop table migrate_map_572fc0732a7a3;
drop table migrate_map_572fc07332de0;
drop table migrate_map_572fc0733be45;
drop table migrate_map_572fc07344566;
drop table migrate_map_572fc07349dba;
drop table migrate_map_572fc07350128;
drop table migrate_map_block_content_body_field;
drop table migrate_map_block_content_type;
drop table migrate_map_d6_comment;
drop table migrate_map_d6_comment_entity_display;
drop table migrate_map_d6_comment_entity_form_display;
drop table migrate_map_d6_comment_entity_form_display_subject;
drop table migrate_map_d6_comment_field;
drop table migrate_map_d6_comment_field_instance;
drop table migrate_map_d6_comment_type;
drop table migrate_map_d6_custom_block;
drop table migrate_map_d6_date_formats;
drop table migrate_map_d6_dblog_settings;
drop table migrate_map_d6_field;
drop table migrate_map_d6_field_formatter_settings;
drop table migrate_map_d6_field_instance;
drop table migrate_map_d6_field_instance_widget_settings;
drop table migrate_map_d6_file;
drop table migrate_map_d6_file_settings;
drop table migrate_map_d6_filter_format;
drop table migrate_map_d6_imagecache_presets;
drop table migrate_map_d6_node__blog;
drop table migrate_map_d6_node__bookmark;
drop table migrate_map_d6_node__inspirational_quote;
drop table migrate_map_d6_node__page;
drop table migrate_map_d6_node__photo;
drop table migrate_map_d6_node__quotes;
drop table migrate_map_d6_node__source_code;
drop table migrate_map_d6_node__story;
drop table migrate_map_d6_node__text;
drop table migrate_map_d6_node_revision__blog;
drop table migrate_map_d6_node_revision__bookmark;
drop table migrate_map_d6_node_revision__inspirational_quote;
drop table migrate_map_d6_node_revision__page;
drop table migrate_map_d6_node_revision__photo;
drop table migrate_map_d6_node_revision__quotes;
drop table migrate_map_d6_node_revision__source_code;
drop table migrate_map_d6_node_revision__story;
drop table migrate_map_d6_node_revision__text;
drop table migrate_map_d6_node_setting_promote;
drop table migrate_map_d6_node_setting_status;
drop table migrate_map_d6_node_setting_sticky;
drop table migrate_map_d6_node_settings;
drop table migrate_map_d6_node_type;
drop table migrate_map_d6_search_settings;
drop table migrate_map_d6_system_cron;
drop table migrate_map_d6_system_date;
drop table migrate_map_d6_system_file;
drop table migrate_map_d6_system_image;
drop table migrate_map_d6_system_image_gd;
drop table migrate_map_d6_system_logging;
drop table migrate_map_d6_system_maintenance;
drop table migrate_map_d6_system_performance;
drop table migrate_map_d6_system_rss;
drop table migrate_map_d6_system_site;
drop table migrate_map_d6_taxonomy_term;
drop table migrate_map_d6_taxonomy_vocabulary;
drop table migrate_map_d6_term_node__1;
drop table migrate_map_d6_term_node__2;
drop table migrate_map_d6_term_node__7;
drop table migrate_map_d6_term_node_revision__1;
drop table migrate_map_d6_term_node_revision__2;
drop table migrate_map_d6_term_node_revision__7;
drop table migrate_map_d6_upload;
drop table migrate_map_d6_upload_entity_display;
drop table migrate_map_d6_upload_entity_form_display;
drop table migrate_map_d6_upload_field;
drop table migrate_map_d6_upload_field_instance;
drop table migrate_map_d6_url_alias;
drop table migrate_map_d6_user;
drop table migrate_map_d6_user_contact_settings;
drop table migrate_map_d6_user_mail;
drop table migrate_map_d6_user_picture_file;
drop table migrate_map_d6_user_role;
drop table migrate_map_d6_user_settings;
drop table migrate_map_d6_view_modes;
drop table migrate_map_d6_vocabulary_entity_display;
drop table migrate_map_d6_vocabulary_entity_form_display;
drop table migrate_map_d6_vocabulary_field;
drop table migrate_map_d6_vocabulary_field_instance;
drop table migrate_map_menu_settings;
drop table migrate_map_search_page;
drop table migrate_map_taxonomy_settings;
drop table migrate_map_text_settings;
drop table migrate_map_user_picture_entity_display;
drop table migrate_map_user_picture_entity_form_display;
drop table migrate_map_user_picture_field;
drop table migrate_map_user_picture_field_instance;
drop table migrate_message_572fc072df61d;
drop table migrate_message_572fc0731606b;
drop table migrate_message_572fc07322bd1;
drop table migrate_message_572fc0732a7a3;
drop table migrate_message_572fc07332de0;
drop table migrate_message_572fc0733be45;
drop table migrate_message_572fc07344566;
drop table migrate_message_572fc07349dba;
drop table migrate_message_572fc07350128;
drop table migrate_message_block_content_body_field;
drop table migrate_message_block_content_type;
drop table migrate_message_d6_comment;
drop table migrate_message_d6_comment_entity_display;
drop table migrate_message_d6_comment_entity_form_display;
drop table migrate_message_d6_comment_entity_form_display_subject;
drop table migrate_message_d6_comment_field;
drop table migrate_message_d6_comment_field_instance;
drop table migrate_message_d6_comment_type;
drop table migrate_message_d6_custom_block;
drop table migrate_message_d6_date_formats;
drop table migrate_message_d6_dblog_settings;
drop table migrate_message_d6_field;
drop table migrate_message_d6_field_formatter_settings;
drop table migrate_message_d6_field_instance;
drop table migrate_message_d6_field_instance_widget_settings;
drop table migrate_message_d6_file;
drop table migrate_message_d6_file_settings;
drop table migrate_message_d6_filter_format;
drop table migrate_message_d6_imagecache_presets;
drop table migrate_message_d6_node__blog;
drop table migrate_message_d6_node__bookmark;
drop table migrate_message_d6_node__inspirational_quote;
drop table migrate_message_d6_node__page;
drop table migrate_message_d6_node__photo;
drop table migrate_message_d6_node__quotes;
drop table migrate_message_d6_node__source_code;
drop table migrate_message_d6_node__story;
drop table migrate_message_d6_node__text;
drop table migrate_message_d6_node_revision__blog;
drop table migrate_message_d6_node_revision__bookmark;
drop table migrate_message_d6_node_revision__inspirational_quote;
drop table migrate_message_d6_node_revision__page;
drop table migrate_message_d6_node_revision__photo;
drop table migrate_message_d6_node_revision__quotes;
drop table migrate_message_d6_node_revision__source_code;
drop table migrate_message_d6_node_revision__story;
drop table migrate_message_d6_node_revision__text;
drop table migrate_message_d6_node_setting_promote;
drop table migrate_message_d6_node_setting_status;
drop table migrate_message_d6_node_setting_sticky;
drop table migrate_message_d6_node_settings;
drop table migrate_message_d6_node_type;
drop table migrate_message_d6_search_settings;
drop table migrate_message_d6_system_cron;
drop table migrate_message_d6_system_date;
drop table migrate_message_d6_system_file;
drop table migrate_message_d6_system_image;
drop table migrate_message_d6_system_image_gd;
drop table migrate_message_d6_system_logging;
drop table migrate_message_d6_system_maintenance;
drop table migrate_message_d6_system_performance;
drop table migrate_message_d6_system_rss;
drop table migrate_message_d6_system_site;
drop table migrate_message_d6_taxonomy_term;
drop table migrate_message_d6_taxonomy_vocabulary;
drop table migrate_message_d6_term_node__1;
drop table migrate_message_d6_term_node__2;
drop table migrate_message_d6_term_node__7;
drop table migrate_message_d6_term_node_revision__1;
drop table migrate_message_d6_term_node_revision__2;
drop table migrate_message_d6_term_node_revision__7;
drop table migrate_message_d6_upload;
drop table migrate_message_d6_upload_entity_display;
drop table migrate_message_d6_upload_entity_form_display;
drop table migrate_message_d6_upload_field;
drop table migrate_message_d6_upload_field_instance;
drop table migrate_message_d6_url_alias;
drop table migrate_message_d6_user;
drop table migrate_message_d6_user_contact_settings;
drop table migrate_message_d6_user_mail;
drop table migrate_message_d6_user_picture_file;
drop table migrate_message_d6_user_role;
drop table migrate_message_d6_user_settings;
drop table migrate_message_d6_view_modes;
drop table migrate_message_d6_vocabulary_entity_display;
drop table migrate_message_d6_vocabulary_entity_form_display;
drop table migrate_message_d6_vocabulary_field;
drop table migrate_message_d6_vocabulary_field_instance;
drop table migrate_message_menu_settings;
drop table migrate_message_search_page;
drop table migrate_message_taxonomy_settings;
drop table migrate_message_text_settings;
drop table migrate_message_user_picture_entity_display;
drop table migrate_message_user_picture_entity_form_display;
drop table migrate_message_user_picture_field;
drop table migrate_message_user_picture_field_instance;
SET FOREIGN_KEY_CHECKS = 1;

There may be a way to drop all those MySQL tables using a wildcard character, but honestly, I didn’t even try that. I just created a list of all of the tables, then used some TextMate macros to create all of those drop table commands, which took about two minutes.

I posted a question about these tables on drupal.org, but haven’t heard back on that in four days, so I just deleted the tables, and my Drupal 8 website still seems to be working fine. I’m just working on a Dev/Test website, so if the site didn’t work afterwards it was no big deal. I had a database backup that I could easily restore from.

In summary, if you were looking for a way to delete all those migrate* database tables after a Drupal 8 migration, I can tell you that I used this technique, and it seems to work fine.