Benji Fisher: The State of the Migrate API in Drupal 8
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.
- Twitter: https://twitter.com/benji17fisher
- LinkedIn: https://www.linkedin.com/in/benjifisher/
- Drupal.org: https://www.drupal.org/u/benjifisher