Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293494

fallback on 'migrate' as the database key causes error messages if migrations use a different source

$
0
0

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.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 293494

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>