Writing a custom process plugin for migrations
At this point, we’ve covered migrating data from CSV, JSON, and database sources, but what about cases where the data from these sources don’t quite align with the way they need to be stored in Drupal?
Migrations can be a tricky thing. While Drupal provides several avenues to source data to migrate in, there will be many cases where you need to manipulate that incoming data to get it to a satisfactory state, either for storage or cleanup purposes. Fortunately, creating process plugins is easy, and you will be manipulating data in a migration in no time.
How to do it…
Let’s take a look at an example of writing a process plugin. Using the previous example, a custom source plugin that fetches data from a database table, assume we now have to pull an additional field for the migration, no_index
. While querying the data is easy, the data itself is not suitable for storage in the metatag field (https://www...