Enhance your testing experience with the Migrate Default Content module

Ramon Vilar - rvilar

About me

Ramon Vilar - rvilar

CEO & Drupal developer

The origins

Why we need this?

Our development process

  • Install the project as our development workflow
  • For that reason, we can't back up in a DB for content.
  • But we need content for testing and QA

Installed site with no content

Installed site with content

The requirements

Easy to use, easy to maintain

Easy to use

  • Developer oriented solution
  • Use of Migrate API as our base
  • Easy to create content
    drush migrate-import <content>
  • Easy to remove content
    drush migrate-rollback <content>

Easy to maintain

  • Plain text files for content (CSV and YAML atm)
  • A new use case for a content is a new line in our text file
  • New content for a new entity is a new file

Our module

Migrate default content

History - Past

  • On D7:
    • Bunch of YAML files for entity and field definitions
    • One CSV file for every YAML entity definition
    • Integration with:
      • Node, Comment, Menu, User
      • Organic Groups
      • Field Collection
      • EntityReference

History - Present

  • On D8:
    • Content is on YAML files (or CSV atm)
    • Entity definitions are no longer necessary
    • Integration with all entities
    • Multilingual support


  • Based on Migrate API
  • Data source files in a folder out of docroot (recommended)
  • Attachments in /files folder
  • Auto discovery fields for entities based on labels
  • entity.bundle.yml


Show me the code!

Simple example


  title: Lorem ipsum
  uid: editor_test
    value: "

And this is all the lorem ipsum dolor text.

" summary: This is a summary format: basic_html field_attached_documents: - image1.png - doc2.pdf status: 1

Entity reference


  title: This is an entity reference example
  uid: editor_test
    - Lorem ipsum
    - Another example
    - news
    - sports
  status: 1

Multilingual example


  title: Lorem ipsum CA text
    value: "

And this is all the catalan content lorem ipsum dolor text.

" summary: This is our CA summary format: basic_html translation_origin: Lorem ipsum


Show me the roadmap


  • Lightweight core
  • JSON data source
  • Paragraph integration
  • UI