1

I'm trying to migrate content from my current D7 site to a Drupal 8 installation.

I've managed to import some of the nodes, and now I want to import the comments for those nodes.

Every time I click on "run" (.../admin/structure/migrate/manage/importarComentarios/migrations/importar-comentarios/process/run) I get an error:

error

What am I doing wrong?

This is my migrate_plus.migration.importarComentarios.yml file:

id: importar-comentarios label: Comments

migration_tags: - CSV

migration_group: importarComentarios

source:
  plugin: csv
  path: 'public://csv/exportar-comentarios-genericos.csv'
  header_row_count: 1
  delimiter: ','
  enclosure: '"'
  keys:
    - id
  column_names:
    0:
      nid: 'nid'
    1:
      created: 'created'
    2:
      body: 'body'
    3:
      autor: 'autor'
    4:
      cid: 'cid'
    5:
      titulo: 'titulo'
    6:
      mail: 'mail'

destination:
  plugin: entity:comment

process:
  entity_id: nid
  subject: title
  'comment_body/value': body
  'comment_body/format':
    plugin: default_value
    default_value: "html"    
  # Migrate our custom field
  field_mail: mail    
  field_nombre: autor
  status:
    plugin: default_value
    default_value: '1'    
  created: created
  nombre: autor
  email: mail
  # The comment type (aka the comment's bundle).  
  comment_type:
    plugin: default_value
    default_value: 'comentario'      
  # The type of entity we're attaching this comment to.  
  entity_type:
    plugin: default_value
    default_value: 'node'
  # The field we should attach this comment to. This is a field on your node.
  field_name:
    plugin: default_value
    default_value: 'comentarios'

migration_dependencies: {}

And this is the migration overview:

This is the overview This is the overview

This is the destination This is the destination

This is the process This is the process

And when clicking the source, I get:

The website encountered an unexpected error. Please try again later.

My configuration is:

My content type is called contenido My content type is called contenido

And these are the fields of my comments And these are the fields of my comments

And my contenido content type has a comentarios field for comments And my contenido content type has a comentarios field for comments

  • The unexpected error thing is the equivalent of a windows blue screen. Check your server error logs and recent errors in Drupal logs and post them to see what is happening exactly. – Berdir Apr 5 '18 at 7:08
  • Alternatively enable verbose error logging with backtrace in the settings and try the things that cause the unexpected error page again. – Berdir Apr 5 '18 at 7:08
0
  keys:
    - id

The yml is using a key 'id' that is not defined in the column_names. Since you have a 'nid' column, I suggest changing 'id' to 'nid'.

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.