Problem/Motivation
I am creating migrations that use the local Drupal 8 site as the source (to convert image fields and other entities to media entities).
Accordingly, my migration's source is configured like this:
source:
# Use the site's own DB as the source.
key: default
target: default
However, when I run a migration command such as 'drush ms MYMIGRATION', I see this warning:
[error] Message: Failed to connect to your database server. The server reports the following
message: /No database connection configured for source plugin variable/.
* Is the database server running?
* Does the database exist, and have you entered the correct database name?
* Have you entered the correct username and password?
* Have you entered the correct database hostname?
This is caused by a combination of migrate's SqlBase source doing this:
protected function setUpDatabase(array $database_info) {
if (isset($database_info['key'])) {
$key = $database_info['key'];
}
else {
// If there is no explicit database configuration at all, fall back to a
// connection named 'migrate'.
$key = 'migrate';
}
and a migration probably in migrate_drupal using the Drupal\migrate_drupal\Plugin\migrate\source\Variable plugin.