0

I've been working on a personal test site for a while and wanted to set up another one for someone else. This just involves running a migration to import all the articles from a CSV file. It's worked in the past but on the most recent attempts I keep getting errors.

I'm using the following modules:

  • Migrate Plus
  • Migrate Source CSV
  • Migrate Tools

The error is not very specific. It just says failed migration. Below is the output of the migration drush migrate-import article_import --debug.

Using the Drush script found at /Applications/DevDesktop/tools/vendor/drush/drush/drush.launcher using proc_open
Loading drushrc "/Applications/DevDesktop/tools/vendor/drush/drush/drushrc.php" into "drush" scope. [0.01 sec, 2.95 MB]                                                                                                          [bootstrap]
Cache HIT cid: 8.1.17-commandfiles-0-d62e1df8f3ac5c588065a4c35f5fb135 [0.02 sec, 2.99 MB]                                                                                                                                            [debug]
Bootstrap to phase 0. [0.17 sec, 8.08 MB]                                                                                                                                                                                        [bootstrap]
Bootstrap to phase 1. [0.17 sec, 8.08 MB]                                                                                                                                                                                        [bootstrap]
Drush bootstrap phase : bootstrap_drupal_root() [0.18 sec, 8.57 MB]                                                                                                                                                              [bootstrap]
Initialized Drupal 8.6.1 root directory at /Users/Noah/Sites/devdesktop/drupal-8.6.1 [0.19 sec, 8.58 MB]                                                                                                                         [bootstrap]
Find command files for phase 1 (max=1) [0.19 sec, 7.08 MB]                                                                                                                                                                           [debug]
Cache HIT cid: 8.1.17-commandfiles-1-3124f7209a887277b55472999b93bdc2 [0.19 sec, 7.08 MB]                                                                                                                                            [debug]
Cache HIT cid: 8.1.17-annotationfiles-1-d7b3bf1ac55fb9d52f6b1a9cf998e002 [0.19 sec, 7.16 MB]                                                                                                                                         [debug]
Bootstrap to phase 5. [0.25 sec, 8.72 MB]                                                                                                                                                                                        [bootstrap]
Drush bootstrap phase : bootstrap_drupal_site() [0.27 sec, 9.36 MB]                                                                                                                                                              [bootstrap]
Initialized Drupal site default at sites/default [0.27 sec, 9.36 MB]                                                                                                                                                             [bootstrap]
Find command files for phase 2 (max=5) [0.28 sec, 7.79 MB]                                                                                                                                                                           [debug]
Drush bootstrap phase : bootstrap_drupal_configuration() [0.28 sec, 7.79 MB]                                                                                                                                                     [bootstrap]
Create from request [0.28 sec, 7.8 MB]                                                                                                                                                                                               [debug]
add service modifier [0.28 sec, 7.95 MB]                                                                                                                                                                                             [debug]
Find command files for phase 3 (max=5) [0.28 sec, 7.95 MB]                                                                                                                                                                           [debug]
sql-query: SELECT 1; [0.29 sec, 8.09 MB]                                                                                                                                                                                            [notice]
Executing: mysql --defaults-extra-file=/private/tmp/drush_BFAC4P --database=drupal_8_6_1 --host=127.0.0.1 --port=33067 --silent  < /private/tmp/drush_e9fdFh
  1
sql-query: SHOW TABLES; [0.32 sec, 8.09 MB]                                                                                                                                                                                         [notice]
Executing: mysql --defaults-extra-file=/private/tmp/drush_YSobxS --database=drupal_8_6_1 --host=127.0.0.1 --port=33067 --silent  < /private/tmp/drush_xf1Y3m
  batch
  block_content
  block_content__body
  block_content_field_data
  block_content_field_revision
  block_content_revision
  block_content_revision__body
  cache_bootstrap
  cache_config
  cache_container
  cache_data
  cache_default
  cache_discovery
  cache_discovery_migration
  cache_dynamic_page_cache
  cache_entity
  cache_menu
  cache_migrate
  cache_page
  cache_render
  cache_toolbar
  cachetags
  comment
  comment__comment_body
  comment_entity_statistics
  comment_field_data
  config
  config_snapshot
  file_managed
  file_usage
  history
  key_value
  key_value_expire
  menu_link_content
  menu_link_content_data
  menu_tree
  migrate_map_article_import
  migrate_message_article_import
  node
  node__body
  node__field_author
  node__field_date
  node__field_publication
  node_access
  node_field_data
  node_field_revision
  node_revision
  node_revision__body
  node_revision__field_author
  node_revision__field_date
  node_revision__field_publication
  queue
  router
  search_dataset
  search_index
  search_total
  semaphore
  sequences
  sessions
  shortcut
  shortcut_field_data
  shortcut_set_users
  taxonomy_index
  taxonomy_term__parent
  taxonomy_term_data
  taxonomy_term_field_data
  url_alias
  user__roles
  user__user_picture
  users
  users_data
  users_field_data
  watchdog
Drush bootstrap phase : bootstrap_drupal_database() [0.34 sec, 8.1 MB]                                                                                                                                                           [bootstrap]
Successfully connected to the Drupal database. [0.34 sec, 8.1 MB]                                                                                                                                                                [bootstrap]
Find command files for phase 4 (max=5) [0.34 sec, 8.1 MB]                                                                                                                                                                            [debug]
Drush bootstrap phase : bootstrap_drupal_full() [0.34 sec, 8.1 MB]                                                                                                                                                               [bootstrap]
About to bootstrap the Drupal 8 Kernel. [0.34 sec, 8.1 MB]                                                                                                                                                                           [debug]
Finished bootstraping the Drupal 8 Kernel. [0.44 sec, 13.76 MB]                                                                                                                                                                      [debug]
Cache HIT cid: 8.1.17-install_profile-66ecfeb9791a023150773849f1550c5d [0.44 sec, 13.85 MB]                                                                                                                                          [debug]
Find command files for phase 5 (max=5) [0.44 sec, 13.91 MB]                                                                                                                                                                          [debug]
Cache HIT cid: 8.1.17-install_profile-66ecfeb9791a023150773849f1550c5d [0.44 sec, 13.92 MB]                                                                                                                                          [debug]
Cache HIT cid: 8.1.17-commandfiles-5-9bf3ecbb863ea82f59fb6b0b758fc109 [0.46 sec, 15.08 MB]                                                                                                                                           [debug]
Bootstrap to phase 6. [0.55 sec, 16.78 MB]                                                                                                                                                                                       [bootstrap]
Drush bootstrap phase : bootstrap_drupal_login() [0.55 sec, 16.78 MB]                                                                                                                                                            [bootstrap]
Find command files for phase 6 (max=6) [0.6 sec, 18.59 MB]                                                                                                                                                                           [debug]
Found command: migrate-import (commandfile=migrate_tools) [0.6 sec, 18.59 MB]                                                                                                                                                    [bootstrap]
Calling hook drush_migrate_tools_migrate_import [0.71 sec, 20.45 MB]                                                                                                                                                                 [debug]
Calling Drupal\migrate_tools\MigrateExecutable::import() [0.72 sec, 21.26 MB]                                                                                                                                                        [debug]
HERE --> Processed 116 items (0 created, 0 updated, 116 failed, 0 ignored) - done with 'article_import' [1.04 sec, 22.67 MB]                                                                                                              [status]
--> article_import Migration - 116 failed. [1.04 sec, 22.7 MB]                                                                                                                                                                       [error]
Returned from hook drush_migrate_tools_migrate_import [1.04 sec, 22.7 MB]                                                                                                                                                            [debug]
Command dispatch complete [1.04 sec, 22.64 MB]

Below is my migration config:

langcode: en
status: true
dependencies: {  }
id: article_import
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: null
label: 'Import articles'
source:
  plugin: csv
  path: Path/To/articles.csv
  delimiter: ','
  enclosure: '"'
  header_row_count: 1
  keys:
    - id
  column_names:
    -
      id: 'Unique Id'
    -
      title: Title
    -
      date: Date
    -
      publication: Publication
    -
      body: 'Article body'
process:
  title: title
  field_author: author
  field_date:
    plugin: format_date
    from_format: m/d/Y
    to_format: Y-m-d
    source: date
  field_publication: publication
  body/format:
    plugin: default_value
    default_value: full_html
  body/value: body
  type:
    plugin: default_value
    default_value: article
destination:
  plugin: 'entity:node'
migration_dependencies: null

I'm using Acquia Dev Desktop, in case that makes a difference.

0

You already use the module Migrate Tools. So you can use UI to check status and logs when you migrate. You need to visit url admin/structure/migrate to view list of migration and go to specific group to show status and logs.

Or you can check in your database, each migration have two tables to log status and message when migrate. One is migrate_map_MIGRATION_ID and one is migrate_message_MIGRATION_ID

In some case log message can write to table database. So you need debug to know why that row failed with tips drush mim MIGRATION_ID --idlist=KEY_ROW_FAILED. Note: you need to know use xdebug.

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.