Evolving Web Newsletter
Sign up for tutorials, best practices and insights, plus info about our acclaimed Drupal Training series.
We just upgraded our site to Drupal 8, and a big part of that was migrating content. Most content was in JSON files or SQL dumps, which are supported by Drupal's migrate module. But what about images and other files? How could we bring those along?
We'll show how to write a custom migrate process plugin!
This post is based on a talk I gave at DrupalCon Barcelona and this year at MidCamp. You can see a video version of the talk below.
Recently we needed to import a fairly large dataset into Drupal. There were 200,000 items to import, the data changed relatively frequently, and we needed them to be Drupal entities so that we could make them searchable with Apache Solr. We would normally import data using Feeds or Migrate. This time, however, we had higher speed requirements, so we tried something different: importing directly into the database.
Sometimes, we find issues with content that are not anticipated by the planning process since they don't show up by looking at sample content or discussing the major use cases of the site. By looking at real content during the data import phase, these issues can be dealt with at an early stage in the development process.
Building a comprehensive information architecture for a content-heavy website can be a challenge. Luckily, Drupal is great for rapid development and by building content types early on, it's easier to discover issues with either the content, design, or architectural decisions.
Every project we do at Evolving Web has a content import component. Whether the content consists of legacy data sources or a single CSV file with freshly written text, we usually have enough content to consider writing one or several import scripts to import it into Drupal.