in my Drupal 8 site, I want to export certain nodes and taxonomy terms into files (JSON or XML) using the Migrate module. (The goal is to have this data in Version control, and to be able to import/update it later.)

However, I have trouble in finding any examples for exporting from Drupal to files (there are many for the other direction).

Can one of suggest me which (preferably core) plugins from Migrate I can use as source (something that reads entities, with being able to define the IDs to be exported) and also as destination (something that writes into JSON/XML or even YAML).

  • I don't think that makes much sense. Have a look at drupal.org/project/default_content instead, which uses the normalization API, not migration.
    – Berdir
    Jul 19, 2017 at 22:32
  • Thanks for your comment! I've already tried Default Content but it fails with a bug when importing its generated JSON, and the alpha version does not seem much trustworthy. Why do you think Migrate does not make much sense? It's core functionality, and one can granularly trigger data imports. Jul 21, 2017 at 22:44
  • 1
    Migrate is mostly used to import data. Migrate needs source and destination plugins, We actaully wrote some D8 source plugins but I don't think I've seen json/xml destination plugins yet. And you have to define the mapping of the fields and so on, so if that is extend, you need to upgrade your migration. A lot of install profiles like thunder are using default_content. If you found bugs, report it in the issue queue, but it's fairly stable for an alpha. Migrate is in core but experimental and so far has been way more unstable than default_content, which 90% based on stable normalization apis
    – Berdir
    Jul 22, 2017 at 9:05


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.