Skip directly to content

Benji Fisher: The State of the Migrate API in Drupal 8

Date: 
Tuesday, February 5, 2019 - 6:30pm to 9:00pm
Location: 

Genuine

500 Harrison Avenue, Suite 5R
Boston, MA
map link

Event Type: 

The Migrate API started as a contrib module in Drupal 6 and 7. From the start, it was designed to handle large-scale projects, creating Drupal nodes, taxonomy terms, etc., from almost any source: another Drupal site, an XML or CSV file, or the database from another CMS. The base module kept track of what had already been brought into the site, so it supported incremental migrations as well as updates of previously migrated content.

In order to use these versions of the Migrate API, the site owner needed to implement a custom module, written in PHP.

For Drupal 8, the Migrate API was adopted by core, and totally rewritten. Originally, the plan was to have a stable version and use it for the upgrade path (from Drupal 6 and Drupal 7) before the release of Drupal 8.0. This plan turned out to be too ambitious: the core Migrate module was considered experimental until it was declared stable in Drupal 8.5.0. Related modules (Migrate Drupal and Migrate Drupal UI) were declared stable in Drupal 8.6.0, and Migrate Drupal Multilingual is still experimental (and so far just a stub).

Even before it was declared stable, the Migrate API was used widely, and there are already several contrib modules built around it. Many sites have used the Migrate API to upgrade to Drupal 8, and it looks like migration will continue to be a common task as Drupal 7 nears its end of life in 2021. It is also being used as a replacement for the Feeds module, to periodically consume feeds (Atom, RSS, and such) and create content in Drupal.

Part of the rewrite involved leveraging the Drupal 8 plugin system. We often use a custom module to leverage the Migrate API, but that module is mostly configuration stringing together various plugins rather than PHP code. For simple migrations, it is even possible to skip the module entirely and just use site configuration. In the near future, we should have UI modules that can handle simple migrations without any custom code. Then the Migrate API will provide the back end for a true replacement for the Feeds module.

In this talk, I will review some of this background and then I will indulge in some code examples and lessons learned from working with the Migrate API on some recent projects.

Presenter: 
Benji Fisher
Benji started out as a math nerd, which is why he uses a Yellow Pig as his avatar. He went from being an enthusiastic mathlete in high school to getting his A.B. and Ph.D. in mathematics and taught for several years. Benji built his first web site in 1996 for the class he was teaching at the time, and dreamed of the day when students would routinely look on the web for their homework assignments so that he would not have to write them on the blackboard.
 
Benji continued to work with the web as a hobby, adding CSS, Javascript, PHP, and MySQL to his toolchest, and started dabbling with Drupal in 2009 (or maybe a little earlier). Along the way, he also became a Vim wizard, developing one of the most popular plugins for that text editor and "[a]nswering lots of user questions" on the vim users' mailing list. Since 2012, he has been making a living working with Drupal.
 
Benji cares--emotionally, not just intellectually--about avoiding duplicated effort. That is why he enjoys working with open-source software: when one person solves a problem, they can share that solution with the rest of the world, and the rest of the world can build on that solution.
 
Benji works on issues for Drupal core and several contrib modules as well as documentation (maintaining the Installing Drupal 8 guide), and he participates in the weekly UX call. He maintains four projects on drupal.org, including the Vim Plugin For Drupal and the Gallery2 migrate module (based on the Drupal 7 Migrate API). He has also volunteered as a mentor at several Drupal camps and most North American DrupalCons since 2013. He reported and helped fix SA-CONTRIB-2015-130, a Cross Site Scripting (XSS) vulnerability in the contrib Migrate module.
 
Benji is a regular attendee at the Boston Drupal meetups, and you can find him on