0

I've just done a super basic user_role import and I'm trying to do a user import. Both are in the same migration group and the migration group has a souce key to specify which db listed in settings.php to use.

I can migrate and roll back the user_role import fine, but as soon as I try to import the users, I get "Migration mysite_user did not meet the requirements. No database connection configured for source plugin d7_user_role"

migrate_plus.migration_group.basic_migration.yml

uuid: 512c4248-7f60-4b08-9cc2-8d804657262c  
langcode: en  
status: true  
dependencies: {  }  
id: basic_migration  
label: basic_migration  
description: 'basic migrations'  
source_type: 'Drupal 7'  
module: null  
shared_configuration:  
  source:  
    key: legacy  

migrate_plus.migration.mysite_role.yml

uuid: 6e288181-f2fd-4e22-885e-02282cc4d222  
langcode: en  
status: true  
dependencies: {  }  
id: mysite_role  
class: null  
field_plugin_method: null  
cck_plugin_method: null  
migration_tags:  
  - 'Drupal 7'  
  - Configuration  
migration_group: basic_migration  
label: 'Mysite Role'  
source:  
  plugin: d7_user_role  
process:  
  id:  
    -  
      plugin: machine_name  
      source: name  
    -  
      plugin: user_update_8002  
  label: name  
  permissions:  
    -  
      plugin: static_map  
      source: permissions  
      bypass: true  
      map:  
        'use PHP for block visibility': 'use PHP for settings'  
        'administer site-wide contact form': 'administer contact forms'  
        'post comments without approval': 'skip comment approval'  
        'edit own blog entries': 'edit own blog content'  
        'edit any blog entry': 'edit any blog content'  
        'delete own blog entries': 'delete own blog content'  
        'delete any blog entry': 'delete any blog content'  
        'create forum topics': 'create forum content'  
        'delete any forum topic': 'delete any forum content'  
        'delete own forum topics': 'delete own forum content'  
        'edit any forum topic': 'edit any forum content'  
        'edit own forum topics': 'edit own forum content'  
    -  
      plugin: flatten  
  weight: weight  
destination:  
  plugin: 'entity:user_role'  
migration_dependencies: null  

migrate_plus.migration.mysite_user.yml  
uuid: bd0ef271-9c8f-40d7-9b65-8147e4cdda47  
langcode: en  
status: true  
dependencies: {  }  
id: mysite_user  
class: Drupal\user\Plugin\migrate\User  
field_plugin_method: null  
cck_plugin_method: null  
migration_tags:  
  - 'Drupal 7'  
  - Content  
migration_group: basic_migration  
label: 'Mysite User'  
source:  
  plugin: d7_user  
process:  
  uid: uid  
  name: name  
  pass: pass  
  mail: mail  
  created: created  
  access: access  
  login: login  
  status: status  
  timezone: timezone  
  langcode:  
    plugin: user_langcode  
    source: language  
    fallback_to_site_default: false  
  preferred_langcode:  
    plugin: user_langcode  
    source: language  
    fallback_to_site_default: true  
  preferred_admin_langcode:  
    plugin: user_langcode  
    source: language  
    fallback_to_site_default: true  
  init: init  
  roles:  
    plugin: migration_lookup  
    migration: d7_user_role  
    source: roles  
  user_picture:  
    -  
      plugin: default_value  
      source: picture  
      default_value: null  
    -  
      plugin: migration_lookup  
      migration: d7_file  
destination:  
  plugin: 'entity:user'  
migration_dependencies:  
  required:  
    - d7_user_role  
    - mysite_role  
  optional:  
    - d7_field_instance  
    - d7_file  
    - language  
    - default_language  
    - user_picture_field_instance  
    - user_picture_entity_display  
    - user_picture_entity_form_display  

Any pointers where to start looking would be much appreciated.

0

The section of migrate_plus.migration.mysite_user.yml that reads this:

roles:
plugin: migration_lookup
migration: d7_user_role
source: roles

has to be edited by switching "d7_user_role" for the id of your user role migration, which in your case is "mysite_role"

roles:
plugin: migration_lookup
migration: mysite_role
source: roles

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.