Migration
Import content from another Migration into Paragraphs
This migration Process snippet example demonstrates how to populate the fields of a Drupal Paragraph. Whereas standard fields can be simply mapped 1:1, and its value attribute (value
) is implied (derived), a Paragraph requires both a target_id
and target_revision_id
. Annotations included inline to demonstrate what is going on within.
yaml
# Field name is `field_paragraph_authors`, specific property `target_id`:
field_paragraph_authors/target_id:
- plugin: migration_lookup
# Dependent Migration called `migration_paragraph_linked_author`
migration: migration_paragraph_linked_author
# Don't create stub content if the row currently being processes does not map to an item in the earlier-run Migration
no_stub: true
# How to map this Migration with the earlier-run Migration
source: sku
- plugin: skip_on_empty
# Method: If empty, skip only this field mapping (`process`), not the entire Row (`row`)
method: process
- plugin: extract
# This destination property is 1st element in the migration-lookup array.
index:
- 0
# Other half of `field_paragraph_authors`, specific property `target_revision_id`:
field_paragraph_authors/target_revision_id:
- plugin: migration_lookup
migration: migration_paragraph_linked_author
no_stub: true
source: sku
- plugin: skip_on_empty
method: process
- plugin: extract
# This destination property is the 2nd element in the migration-lookup array.
index:
- 1
Resources
- 31 days of Drupal migrations by Mauricio Dinarte - August 2019
- Drupal Migration Kick Start and Cheat Sheet by David Lanier of Phase 2 Aug 24
- Unraveling the ETL Data Migration Process. A 3 part series from Tag1 Consulting - Dec 2023 & Jan 2024
- Stop waiting for Feeds module: how to import RSS in Drupal 8 by Campbell Vertesi - June 2017
- Issue on Drupal.org where Mike Ryan, co-author of the migrate module, addresses how to start a migration programmatically
- Youtube Video from Twin Cities Drupal community where Mauricio Dinarte and Benjamin Melançon demonstrate how to implement migrations - June 2017
- Migrating to Drupal From Alternate Sources by Joshua Turton showing migrations from CSV, XML/RSS and Wordpress into Drupal 8 - November 2018
- Nice introduction to Drupal 8 migration by Chris of Redfin Solutions - Nov 2017
- Migrating files and images on Drupal.org - updated February 2023
- Drupal 8 content migrations from CSV or spreadsheet - August 2020
- Drupal Migrations: Getting Started - Nov 2023 - with video. The hosts, Michael Meyers and Janez Urevc, are joined by a panel of additional experts, Benji Fisher, Lucas Hedding, Mauricio Dinarte, and Mike Ryan, who delve deep into the world of Drupal migrations.