I am trying to migrate users and a few other entities from a Drupal 7 site to Drupal 8 with the built-in migration modules and Migrate Plus. I have added a database array in settings.php but something is missing to get the migrations to "see" the right database. I am getting this error.

[Mon May 11 22:22:56.025896 2020] [php7:error] [pid 6389:tid 140003403929344] [client 62419] PHP Fatal error: Method Drupal\user\Plugin\migrate\source\d7\Role::__toString() must not throw an exception, caught Drupal\migrate\Exception\RequirementsException: No database connection configured for source plugin d7_user_role in /var/www//web/core/lib/Drupal/Component/Utility/Unicode.php on line 595, referer:

I have tried adding

   key: database_key

But it did not work.

Any help is greatly appreciated.

Thanks, Josh

1 Answer 1


It's impossible to troubleshoot this remotely but there are a couple of things you can try to get connected to your source DB.

  1. In your group's shared_configuration.source config you can manually add a database key with the same DB setting array properties that the migration module also looks for. For example:
   key: database_key
      driver: mysql
      username: user
      password: pass
  1. Use the migrate update module to template out an initial working migration config rather than manually add your source DB. For example, run: drush migrate:upgrade --legacy-db-key database_key ....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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