Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

Prerequisites:
Existing database entered in the settings.php file.
In this example:

$databases['mg_legacy']['default'] = array (
  'database' => 'mg_legacy',
  'username' => 'xxx',
  'password' => 'xxx',
  'host' => 'localhost',
  'port' => '3306',
  'driver' => 'mysql',
  'prefix' => '',
  'collation' => 'utf8mb4_general_ci',
);

Installation:
Enable module

Description:
With this CustomSQLQuery plugin you can enter a custom SQL string in your migration config file and it will pull the data directly from any database.

It returns all the fields queried in the SQL string in the row object. So any field you select in the SQL query can be accessed by any process plugin or as a source for any field.

IMPORTANT: Any changes to the sql requires you to re-install your custom migration module for the settings to take affect. You can do so with

drush pmu [module_name] -y && drush en [module_name] -y

Please see config below as an example:

id: resources
label: Resources
migration_group: mmg8_legacy_migrations
migration_dependencies:
  required:
    - mmg8_legacy_migrations_article_type
source:
  plugin: custom_sql_query
  key: mg_legacy
  keys:
    - id
  sql_query: 'SELECT resources.id,
                     CONCAT(''/'', resources.slug) as slug,
                     resources.title,
                     resources.description,
                     resources.file,
                     resources.published,
                     resources.category_id,
                     resources.created_at,
                     resources.updated_at,
                     resources.locked,
                     resources.subtitle,
                     resources.archive
                FROM resources resources'
destination:
  plugin: entity:node
  default_bundle: article
process:
  title: title
  path/pathauto:
    plugin: default_value
    default_value: 0 # Disable pathauto.
  path/alias: slug

Activity

Total releases
3
First release
Jul 2025
Latest release
9 months ago
Release cadence
4 days
Stability
67% stable

Release Timeline

Releases

Version Type Release date
8.x-1.5 Stable Jul 9, 2025
8.x-1.4 Stable Jul 8, 2025
8.x-1.x-dev Dev Jul 2, 2025