This project is not covered by Drupal’s security advisory policy.

Content migration is one of the most important factors that any experienced Drupal developers must take into account.

When working on a production state of your projects, upon finishing certain functions, you will need to move the progress to the production site by using the feature and coding export functions.

However, it is not easy as it seems.
If the number of nodes is small, developers can do it manually. But when it amounts to hundreds, thousands, or millions, that is quite risky.

Regarding nodes, entity, and contents related to files, database, entity reference, there is no module support currently.

Indeed, we found one module that exports images to base 64 of Drupal but it is not effective.

That’s why we create migrate content to solve this issue.

Here how the module works.

  • Export

    • Step 1:

      • Export selected entities without fields to JSON

    • Step 2:

      • Export all fields for the selected entities to JSON

    • Step 3:

      • Export all field instances for the selected entities to JSON

    • Step 4: Export all entities content normal fields to JSON

      • Entity define by: entity type + entity bundle + entity id

      • Uri of field resources

    • Text, number, string, date, … => keep format

    • Step 5: Export all Images, files, resource fields

      • get URI => replace “public://” to “resources/”

      • Copy file to folder resources/.

    • Step 6: Export all reference fields to json

      • Kept information:

        • Entity

        • Bundle

        • Target Id

    • Output:

      • result/

        • Entities.json

        • Fields.json

        • FieldInstance.json

        • Data.json

        • Resources folder

        • References.json

  • Import

    • Step 1

      • Read file entities.json => create entities

    • Step 2

      • Read file fields.json => create fields

    • Step 3

      • Read file fieldinstances.json => create fields for each bundle

    • Step 4

      • Read file data.json => check doublicate => insert/update to each content => for the field resources => use uri to load file and save to content

      • Create mapping table => link entity type + entity bundle + entity id to new id

    • Step 5

      • Load file references.json => use mapping table to lookup old id to new id => save field reference to content

 

Project information

Releases