Migrating data from an HTTP API
CSV files and SQL databases are not the only data source you can use for migrations. The Migrate Plus contributed module comes with a URL source plugin. By using the URL plugin as a migration source, the migration can fetch and parse data over HTTP in the following formats:
- JSON
- XML
- SOAP
This means that you can migrate data from any API over the internet, making Migrate Plus an indispensable tool when you need to migrate data over the wire.
Let’s take a look at how this could be used to migrate data from an HTTP API.
How to do it…
At this point, we have given two examples of migration definitions in this chapter. Even though we are migrating from a different kind of source, the format of the migration definition itself is not going to change all that much. We still have our source
, destination
, and process
section.
Imagine that we want to grab data from a public API that returns a JSON response and save...