Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Migrate Delete

3 sites No security coverage
View on drupal.org

This module provides tools to safely delete Drupal migration tracking tables from your database. After completing migrations, you can use its administrative interface or Drush commands to remove tables like `migrate_map_*` and `migrate_message_*`, cleaning up your database. Be aware that this action is irreversible and will permanently remove all migration data and error messages.

Module provides administration tools to safely delete migration related database tables (migrate_map_* and migrate_message_*). This module is designed for Drupal sites that have completed migrations and no longer need the migration tracking tables. It's particularly useful for cleaning up databases after successful migration projects.

Warning

This action cannot be undone. Once migration tables are deleted, all migration tracking data and error messages will be permanently lost. Only use this module when you are certain you no longer need migration data. Make a database backup before using.

Installation

  1. Composer require drupal/migrate_delete
  2. Enable the module through the Drupal admin ui or with Drush:
    drush en migrate_delete
    

Usage

Web UI

  1. Navigate to Configuration > System > Delete Migration Tables (/admin/config/system/migrate-delete)
  2. Review the list of migration tables that will be deleted
  3. Check the confirmation checkbox to acknowledge that this action cannot be undone
  4. Click "Delete all migration tables" to proceed

Drush Commands

The module provides two Drush cli commands:

List Migration Tables

# List all migration tables
drush migrate-delete:list

# or use the alias
drush mdl

This command will show:

  • Count of migration tables found
  • Migration map tables (migrate_map_*)
  • Migration message tables (migrate_message_*)

Delete Migration Tables

# Delete all migration tables
drush migrate-delete:delete

# or use the alias
drush mdd

# Delete without confirmation (use with caution!)
drush migrate-delete:delete -y

# or
drush mdd -y

The delete command will:

  • List all tables that will be deleted
  • Show a warning about permanent data loss
  • Require confirmation (unless -y flag is used)
  • Provide real-time feedback during deletion
  • Show a summary of results

Features

  • Detailed Listing: Shows all tables that will be deleted, grouped by type
  • Safe Table Detection: Only finds and lists actual migration tables matching the expected patterns
  • User Confirmation: Requires explicit confirmation before deletion
  • Security Validation: Validates table names to prevent unauthorized deletions
  • Error Handling: Provides clear feedback on success or failure
  • Drush Integration: Full command-line support with list and delete operations

Security Considerations

  • Tables are validated against expected naming patterns before deletion
  • Provides multiple confirmation steps to prevent accidental deletion

What Gets Deleted

This module will delete:

  • All tables starting with migrate_map_*
  • All tables starting with migrate_message_*

These tables contain:

  • Migration mapping data between source and destination entities
  • Migration error messages and debugging information

Drush Command Examples

List all migration tables:

$ drush migrate-delete:list
Found 10 migration tables:

Migration Map Tables (5):
  - migrate_map_d7_block
  - migrate_map_d7_comment
  - migrate_map_d7_node_article
  - migrate_map_d7_taxonomy_term
  - migrate_map_d7_user

  Migration Message Tables (5):
  - migrate_message_d7_block
  - migrate_message_d7_comment  
  - migrate_message_d7_node_article
  - migrate_message_d7_taxonomy_term
  - migrate_message_d7_user

Use "drush migrate-delete:delete" to delete these tables.

Delete migration tables:

$ drush migrate-delete:delete
Found 10 migration tables that will be deleted:
  Map tables (5): migrate_map_d7_block, migrate_map_d7_comment, ...
  Message tables (5): migrate_message_d7_block, migrate_message_d7_comment, ...

WARNING: This action cannot be undone!

Are you sure you want to delete all these migration tables? (y/N): y

Deleting migration tables...
  ✓ Deleted: migrate_map_d7_block
  ✓ Deleted: migrate_map_d7_comment
  ✓ Deleted: migrate_message_d7_block
  ✓ Deleted: migrate_message_d7_comment
  ...

Successfully deleted 10 migration tables.

Delete migration tables without confirmation:

$ drush migrate-delete:delete -y
Found 10 migration tables that will be deleted:
  Map tables (5): migrate_map_d7_block, migrate_map_d7_comment, ...
  Message tables (5): migrate_message_d7_block, migrate_message_d7_comment, ...

WARNING: This action cannot be undone!

Deleting migration tables...
  ✓ Deleted: migrate_map_d7_block
  ✓ Deleted: migrate_map_d7_comment
  ...

Successfully deleted 10 migration tables.

Drush

Activity

Total releases
1
First release
Jun 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
1.0.x-dev Dev Jun 25, 2025