I'm migrating a site from Drupal 6 to Drupal 8, and to prepare the migration I run drush migrate-upgrade --legacy-db-url=mysql://user:password@localhost/drupal6-db-name --legacy-root=http://drupal6-URL --configure-only
.
Then when I run drush migrate-import --all
I get the following output (I'll paste the whole output for full "tracking"):
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_block_content_type' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_book_settings' [status]
Processed 3 items (3 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_date_formats' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_dblog_settings' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_file_settings' [status]
Processed 0 items (0 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_imagecache_presets' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_search_settings' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_system_cron' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_system_date' [status]
Processed 1 item (0 created, 0 updated, 0 failed, 1 ignored) - done with 'upgrade_d6_system_file' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_system_image' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_system_image_gd' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_system_logging' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_system_maintenance' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_system_performance' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_system_rss' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_system_site' [status]
Processed 13107 items (13107 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_url_alias' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_user_mail' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_user_settings' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_menu_settings' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_search_page' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_taxonomy_settings' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_text_settings' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_update_settings' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_block_content_body_field' [status]
Processed 29 items (29 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_menu' [status]
Missing filter plugin: filter_null. [error]
Processed 3 items (3 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_filter_format' [status]
Processed 11 items (11 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_custom_block' [status]
Processed 60 items (60 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_user_role' [status]
Processed 251 items (29 created, 0 updated, 0 failed, 222 ignored) - done with 'upgrade_d6_block' [status]
Processed 341 items (334 created, 0 updated, 7 failed, 0 ignored) - done with 'upgrade_d6_file' [status]
Processed 0 items (0 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_d6_user_picture_file' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_user_picture_field' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_user_picture_field_instance' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_user_picture_entity_display' [status]
Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'upgrade_user_picture_entity_form_display' [status]
exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in [error]
/home/[user]/dev/core/modules/migrate/src/Plugin/migrate/process/Flatten.php:30
Stack trace:
#0 /home/[user]/dev/core/modules/migrate/src/Plugin/migrate/process/Flatten.php(30): ArrayIterator->__construct('')
#1 /home/[user]/dev/core/modules/migrate/src/MigrateExecutable.php(392): Drupal\migrate\Plugin\migrate\process\Flatten->transform('', Object(Drupal\migrate_tools\MigrateExecutable),
Object(Drupal\migrate\Row), 'permissions')
#2 /home/[user]/dev/core/modules/migrate/src/Plugin/migrate/process/Migration.php(132): Drupal\migrate\MigrateExecutable->processRow(Object(Drupal\migrate\Row), Array)
#3 /home/[user]/dev/core/modules/migrate/src/MigrateExecutable.php(378): Drupal\migrate\Plugin\migrate\process\Migration->transform('30', Object(Drupal\migrate_tools\MigrateExecutable),
Object(Drupal\migrate\Row), 'roles')
#4 /home/[user]/dev/core/modules/migrate/src/MigrateExecutable.php(217): Drupal\migrate\MigrateExecutable->processRow(Object(Drupal\migrate\Row))
#5 [internal function]: Drupal\migrate\MigrateExecutable->import()
#6 phar:///usr/local/bin/drush/includes/drush.inc(720): call_user_func_array(Array, Array)
#7 phar:///usr/local/bin/drush/includes/drush.inc(711): drush_call_user_func_array(Array, Array)
#8 /home/[user]/dev/modules/migrate_tools/migrate_tools.drush.inc(275): drush_op(Array)
#9 [internal function]: _drush_migrate_tools_execute_migration(Object(Drupal\migrate\Plugin\Migration), 'upgrade_d6_user', Array)
#10 /home/[user]/dev/modules/migrate_tools/migrate_tools.drush.inc(241): array_walk(Array, '_drush_migrate_...', Array)
#11 [internal function]: drush_migrate_tools_migrate_import()
#12 phar:///usr/local/bin/drush/includes/command.inc(373): call_user_func_array('drush_migrate_t...', Array)
#13 phar:///usr/local/bin/drush/includes/command.inc(224): _drush_invoke_hooks(Array, Array)
#14 [internal function]: drush_command()
#15 phar:///usr/local/bin/drush/includes/command.inc(192): call_user_func_array('drush_command', Array)
#16 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#17 phar:///usr/local/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#18 phar:///usr/local/bin/drush/includes/startup.inc(325): drush_main()
#19 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#20 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#21 {main}
Any ideas here?
I am running:
CENTOS 7.2 x86_64,
Apache 2.4.23,
PHP 5.5.37,
Drush 8.1.3.
Thank you.
Comments
Comment #2
mikeryanThere's been some issue in the past with migrate-upgrade property rewriting ID references - what does your upgrade_d6_user configuration look like (go to /admin/config/development/configuration/single/export and select Migration, then upgrade_d6_user)? Are you using the latest -dev of migrate_upgrade? Are you editing the migrations at all?
Comment #3
GUE-Andreas CreditAttribution: GUE-Andreas commentedThe upgrade_d6_user configuration looks like this:
I was using migrate_upgrade-8.x-2.0-beta1, and not editing any migrations at all.
Now I tried the latest -dev of migrate_upgrade, and everything seems normal when I run the
drush migrate-upgrade [...]
, but then when I rundrush migrate-status
I suddenly get a whole lot of lines withThe upgrade_d6_user configuration looks exactly the same as before, except for the uuid.
Thank you. I appreciate the time you spend on this.
Comment #4
mikeryanWhen providing more info to an issue marked "Postponed (maintainer needs more info)", please be sure to set the status back to "Active" for visibility.
Also note that <code> is better than <blockquote> for rendering PHP/YAML/etc.
Second problem first, "The specified database connection is not defined: drupal_6" has been fixed as of today, see #2793723: Using --configure-only migrations fails.
If you update to the latest -dev with that fix, do you still see the Flatten error?
Comment #5
mikeryanComment #6
GUE-Andreas CreditAttribution: GUE-Andreas commentedThanks Mike,
I appreciate the hints on usage of this website. (Honestly, I was wondering but hesitant to ask)
With the latest -dev, the second problem is now gone. But the Flatten error is still the same. I tried both the 8.x-2.x-dev and the 8.x-3.x-dev with the same result.
Comment #7
mikeryanFrom
That it is attempting to resolve a reference to role ID 30 (rid) from the D6 users_roles table, and not finding such a role having been imported. Can you look in your D6 database and see if there's a users_roles row with rid=30, and check to make sure that rid=30 exists in your role table in D6?
Comment #8
GUE-Andreas CreditAttribution: GUE-Andreas commentedWell,
That's a little embarrassing, but that seems to have been the cause of this error. I did in fact not have any role with rid=30 left. It had been deleted for some reason. When I removed all references to it in users_roles, the error disappeared.
Now I am instead getting errors because the migration doesn't seem to allow duplicate user names in the D6 database, and we have plenty of those. (We use e-mail address as the unique external identifier instead of user name)
Unless you know of a fix to that problem I guess I'll just get to work on trying to fix all duplicate user names and then try this process again..
Thanks again for all your help!
Comment #10
drzraf CreditAttribution: drzraf commentedAnother one of the same kind:
Comment #11
Matt BThis issue needs to be re-opened. I am getting the same as drzaf when I import upgrade_d6_user. Using Drupal 8.3.2, migrate upgrade 8.x-3.0-rc1, migrate_plus 8.x-4.0-beta1 and migrate_tools 8.x-4.0-beta1, and following the instructions here: https://www.drupal.org/node/2350651
I have not edited any migrations.
Comment #12
drzraf CreditAttribution: drzraf commentedGive #2850312: d6_filter_format is hard coded, causing dependent migration to fail 's patch a try. I've the feeling it did the trick in my case.
Comment #13
Matt Bthanks for the tip drzaf, unfortunately the patch has not made any difference.
Comment #14
Matt BI've just re-ran the migration on a fresh install, with the patches, still the same error on upgrade_d6_user:
Comment #15
johnvb CreditAttribution: johnvb commentedI've applied the patches which fixed the import of user roles (all my roles have imported and are in the D8 configuration). However I'm getting exactly the same problem as in the post above. My role seems to be loading OK it's just when the code processes the permissions in the current row it returns NULL, which of course fails when the flatten plugin is fired.
I'm finding it difficult to debug where in the code the permissions property of the row should be loaded.
Comment #16
hellobank CreditAttribution: hellobank commentedI got the same error when the proceed to Migration upgrade_d6_user
Comment #17
Begun CreditAttribution: Begun commentedI am having the same issue as the previous poster. Would be good to re-open this ticket as it seems to be a re-occurring issue.
Comment #18
Publishing Future CreditAttribution: Publishing Future commentedI get the same error when running drush migrate-import upgrade_d6_user with Drupal 8.3.4. Previous migration of user roles worked properly after applying the patch.
Comment #19
Publishing Future CreditAttribution: Publishing Future commentedAccording https://www.drupal.org/node/2850312#comment-12108811 the missing "upgrade_"-prefix in the migrations names is the reason for the problem. The relevant part of my migration file (go to /admin/config/development/configuration/single/export and select Migration, then upgrade_d6_user) looks like this:
When adding the "upgrade_"-prefix to the migrations names the migration works without problems:
Comment #20
Olarin CreditAttribution: Olarin at Kosada commentedNobody actually re-opened this issue, but for those following along at home, I think the commit for https://www.drupal.org/node/2875405 should have solved it.
Comment #21
Begun CreditAttribution: Begun commentedThanks for the update Olarin. I had tried to re-open this issue, but unfortunately that can only be done by the maintainers