---
title: "Troubleshooting the \"No database connection configured for source plugin\" error during a website migration"
date: "2022-03-01T00:16:56+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/93901-troubleshooting-no-database-connection-configured-source-plugin-error-during-website-migration"
id: "8d4ce9c8-3176-490d-8161-a8e73b67c623"
---

When trying to upgrade a D7 or D6 website to D8, it might be needed to declare the source database in your settings.php file, as explained in the Drupal documentation [https://www.drupal.org/docs/upgrading-drupal/upgrade-using-drush](https://www.drupal.org/docs/upgrading-drupal/upgrade-using-drush)

    $databases['migrate']['default'] = [
      'database' => 'drupal7db',
      'username' => 'drupal7db',
      'password' => 'drupal7db',
      'prefix' => '',
      'host' => 'd7db',
      'port' => '3306',
      'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
      'driver' => 'mysql',
    ];

If you encounter an error message containing the following in your php-errors.log file

    No database connection configured for source plugin...

... it might be that the place you are the `$databases['migrate']['default']` snippet is not correct; it needs to be positioned **after** the [Acquia Cloud required line](/node/56321).