Migrate Staging Table
This module allows you to use database tables as a staging area for data migration. It provides plugins to use these tables as sources for importing data, destinations for exporting data, and for looking up values during the migration process.
A Drupal module providing support for using database tables as migration sources, destinations and for data lookups.
Overview
This module provides a generic method to migrate data into, out of, and lookup from a database staging table. It's useful for complex migrations that need an intermediate staging area for data transformation and lookup.
Requirements
- Drupal 9, Drupal 10 or Drupal 11
- Migrate module (core)
Installation
composer require drupal/migrate_staging_table
drush en migrate_staging_table
Usage
Provided Plugins
Source Plugin: staging_table
Use a database table as a source for migrations.
source:
plugin: staging_table
table: my_staging_table
fields:
- id
- field1
- field2
conditions:
- column: status
value: 1
operator: '='
Destination Plugin: staging_table
Write migration data to a database table.
destination:
plugin: staging_table
table: my_staging_table
fields:
field1:
type: varchar
length: 255
field2:
type: text
field3:
type: int
indexes:
field1_index:
- field1
description: "My staging table for migration"
Process Plugin: staging_table_lookup
Lookup values from a staging table during migration.
process:
field_destination:
plugin: staging_table_lookup
source: source_id
table: my_staging_table
field: field_to_retrieve
Configu
ration
Each plugin requires specific configuration parameters:
table: Name of the database table to use
fields: Field definitions for the table (for destination plugin) or field names to select (for source plugin)
conditions: (Source only) Optional conditions to filter source data
Notes
The module automatically manages the creation of tables for the destination plugin.
Each table automatically includes id and created fields
When a table already exists, the module will only add new fields, not modify existing ones.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 2.0.0-alpha1 | Pre-release | 9–11 | Make D11 Compatible | Apr 24, 2025 |