0

I tried to migrate a site from Drupal 7 to Drupal 8.1 using drush (migrate-import --all) and the following modules:

  • Migrate Plus
  • Migrate Tools
  • and the D8 core migrate modules.

It doesn't migrate the image of my nodes and the body field is empty. Do I have to create the same content types with similar fields first, or should I let the Migrate module do this?

The empty body looks like a problem with the text format filter. I use the full HTML text format with CkEditor on Drupal 7, but this filter exists on Drupal 8 too, so I don't understand why it happens.

0

The solution for the body-field:

it must be a translation problem. I changed the language of the Drupal 8.1 site to the same language as the Drupal 7 site and now the body field isn't empty anymore.

But the images are still missing. I noticed that no files were imported. Under /admin/content/files there is nothing! any help in this case?

0

Body field of Node is a compound field so we define body field like this in .yml file.

process:
......
......
  'body/format':
    plugin: static_map
    bypass: true
    source: body_format
    map:
      1: plain_text
      2: restricted_html
      3: full_html
      4: full_html
  'body/value': body_value
  'body/summary': body_summary

Also in php class file that extends SqlBase for migration you need to define body.

public function fields() {
    $fields = $this->baseFields();
    $fields['body/format'] = $this->t('Format of body');
    $fields['body/value'] = $this->t('Full text of body');
    $fields['body/summary'] = $this->t('Summary of body');
    return $fields;
  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.