Migrations

Drupal Migrations (I): Basic Resources

Drupal Migrations (I): Basic Resources

I am working on notes for a draft that should become a book about migration processes built with Drupal and its Migrate API. It is expected to be released in June 2020, and collecting, testing, and shaping the content has become quite a large piece of work.

There are still a few months left before launch, so, to preserve a little mental health and give these tasks some partial meaning, I thought I could publish a few small posts here, based on those working notes.

That way I can share something useful alongside the complementary notes and, if COVID-19 gets me before the book comes out, at least I will have shared something first (I guess).

Well, what do I want to talk about in this post? I would like to make a list of Drupal modules related to migration processes, available as contrib modules that can add functionality to a migration. This article is only a lightweight set of basic resources (I swear).


This article was originally published in https://davidjguru.github.io Picture from Unsplash, user Nils Nedel, @nilsnedel


Table of Contents

1- Introduction 2- Basic Resources - Core Modules 3- Other Basic Resources - Contrib Modules 4- Extra Resources - Contrib Modules for Plugins 5- Migration Runners - Contrib Modules Drush-Related 6- Authors you should know 7- :wq!


This article is part of a series of posts about Drupal Migrations:

1- Drupal Migrations (I): Basic Resources

2- Drupal Migrations (II): Examples

3- Drupal Migrations (III): Migrating from Google Spreadsheet

4- Drupal Migrations (IV): Debugging Migrations First Part

5- Drupal Migrations (V): Debugging Migrations-II


1- Introduction

It is not easy to talk about migrations in general and, of course, it is not easy in the context of Drupal either. To run migrations, you need solid knowledge of the technology, the data models at both the source and destination, some experience with ETL processes, and a certain amount of Drupal plugin know-how. Migrations make heavy use of Drupal-style plugins.

In any case, since the topic is extensive and my time is now short, I thought of this article as a summary catalogue (for quick consumption) of tools and basic resources for working with migrations.

2- Basic Resources - Core Modules

3- Other Basic Resources - Contrib Modules

  • Migrate Plus: [migrate_plus](https://www.drupal .org/project/migrate_plus). Migrate Plus is an essential contrib module which extends the features and capabilities of the Migrate core module with a lot of plugins and extensions.

  • Migrate Tools: migrate_tools. Another essential resource: provides a lot of Drush commands for running and managing Migrations.

  • Migrate Status: migrate_status. This little contrib module lets you get a feedback about a migration process. Do you need to know if a migration is running? this module gives you a service that you can call to check the migration.

  • Migrate Files: migrate_files. It’s such an interesting set of process plugins that you will want to move files and images with it.

  • Migrate Commerce: commerce_migrate. General-purpose framework that extends to the main Migrate module from Drupal Core, for moving data in a Drupal Commerce scenario.

4- Extra Resources - Contrib Modules for Plugins

In Drupal migration processes, we’ll use different resources to process the ETL migration plan. One of these basic resources, as I mentioned in the introduction, is Drupal Plugins, which requires some knowledge and practice. In a migration scenario, plugins help us read information from the E: Source (Source Plugins), perform the T: Processing (Process Plugins), and save data in the L: Destination (Destination Plugins). Putting these three parts together usually gives us a working migration process.

Many modules of the core already bring their own Plugins to facilitate migration processes (as the user module). So let’s review some migration plugins packaged in contributed modules.

Source Plugins Migrate Source Plugin

  • Migrate Source CSV: migrate_source_csv. Contrib Module for migrating data to Drupal 8 from a classic, simple CSV file.

  • Migrate Source SQL: custom_sql_migrate_source_plugin. As a peculiarity of database plugins, this module lets you include SQL queries directly in the .yml file that describes the migration. Those queries will be executed against the source database.

  • Migrate Source YAML: migrate_source_yaml. It’s just a simple tool for migrating content from YAML files.

Processing Plugins Migrate Process Plugins

Destination Plugins: Migrate Destination Plugins & Examples

What kind of Drupal entities will be created in the migrating process? content entities? configuration entities? Take a look.

  • Migrate Destination CSV: d8migrate. It’s a light custom module created by @jonathanfranks.

  • Migrate Destination Config: Class Config.php. Offers a plugin for config migration.

  • Migrate Destination Block: Class EntityBlock.php. Just like and example about the resources that every element can offers in a migration scene, in case of moving Block Entities (are Config Entities) see the PHP classes included in its own module for migrating (Source, Process and Destination).

Drupal 8 Migrate Entity Block

6- Authors you should know

  • Mauricio Dinarte: Mauricio is a developer, consultant, trainer and owner of his own business https://agaric.coop, wrote what is probably the mandatory reading guide for all people who want to learn how to migrate on Drupal: 31 Days of Drupal Migrations, a set of 31 articles published in https://understanddrupal.com/migrations with the most important aspects…examples, exercises, descriptions…to understand the whole internal world of migrations inside Drupal.

An essential training material. In addition, his company’s website, under the tag “migrate” also hosts many very good articles about migration topics: https://agaric.coop/tags/migrate.

Some examples from Mauricio Dinarte:

  1. Introduction to paragraphs migrations in Drupal:
  1. Using migration groups to share configuration among Drupal migrations:
  1. What is the difference between migration tags and migration groups in Drupal?

His profile in Drupal.org: https://www.drupal.org/u/dinarcon.


  • Tess Flynn: I heard about Tess Flynn reading articles by Mauricio Dinarte. That’s how I met this expert developer, speaker and communicator of the Drupal community. On her website https://deninet.com I found content of a different nature, but above all, a series of very interesting articles about migrations under the tag “drupal-migration”: https://deninet.com/tag/drupal-migration.

    Along the way I also discovered that it has several contrib modules related to Migrations and Processing Plugins.

Some examples from Tess Flynn:

  1. Migrate Process URL: Provides Process Plugin to migrate link fields.
  1. Migrate Process Vardump: Helping to debugging migrations.
  1. Many Process Plugins:

Her profile in Drupal.org: https://www.drupal.org/u/socketwench.


Some examples from Danny Sipos:

  1. Your first Drupal 8 Migration:
  1. Dynamic migrations using “templates” in Drupal 8:
  1. Quickly generate the headers for the CSV migrate source plugin using Drush:

His profile in Drupal.org: https://www.drupal.org/u/upchuk.


7- :wq!

comments powered by Disqus

Join to the (Future) Newsletter

De la pradera tiene musho peligro al ataquerl te voy a borrar el cerito torpedo tiene musho peligro pupita al ataquerl diodeno. Torpedo ese pedazo de qué dise usteer a peich ese que llega la caidita pecador.