1

Leaving settings.php in place (but writeable), per instructions 13 + 14 of major upgrade section of https://api.drupal.org/api/drupal/UPGRADE.txt/7.x , with the new D7 codebase but the old D6 DB, i get the following errors:

Notice: Undefined offset: 0 in Database::parseConnectionInfo() (line 1529 of [...]includes/database/database.inc).
Notice: Undefined index: driver in Database::openConnection() (line 1681 of [...]includes/database/database.inc).
Notice: Undefined index: driver in Database::openConnection() (line 1681 of [...]/includes/database/database.inc).
DatabaseDriverNotSpecifiedException: Driver not specified for this database connection: default in Database::openConnection() (line 1682 of [...]includes/database/database.inc).
Notice: Undefined index: driver in Database::openConnection() (line 1681 of [...]includes/database/database.inc).
The website encountered an unexpected error. Please try again later.

Here is the core of the question -- according to the instructions, and normal upgrades, update.php should note that settings.php is D6-style, and change it to D7-style, including db-connection format.

It is not doing so. What could be going wrong? Reading through the script, it determines the DB schema... but it's not obvious to me where it determines the settings.php version and updates it. Help? Thanks!

The installed Drupal 6 release is 6.38, the latest release for Drupal 6.

I first tried to upgrade to Drupal 7.95; then I tried to upgrade to Drupal 7.34, and then again with Drupal 7.0, but I had the same issue.

[[Note: the below is not part of the core of this question, but responds to "why don't you just hardcode D7-style DB connection? I can hard-code the database settings using the Drupal 7 array structure, but that leads to other problems (expecting things that don't exist yet):

Error
Error message
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_7_test.main_system' doesn't exist: SELECT name, schema_version FROM {system} WHERE type = :type; Array ( [:type] => module ) in drupal_get_installed_schema_version() (line 151 of [...]/includes/install.inc).
The website encountered an unexpected error. Please try again later.

Per this report, my assumption is that this means the code is expecting the new D7 codebase because the database connection was D7 style: https://www.drupal.org/node/1308308 ]]

7
  • What instructions? With Drupal 6 being end of life for many years Drupal 7 moved on. In this case you must update the database connection settings to the current Drupal 7 standard, shown in the example settings file. It should take all of a minute to do.
    – mona lisa
    Commented Apr 14, 2023 at 11:28
  • Thanks so much for your reply! Really appreciate it. I agree that Drupal 6 is exotically out of date, and know that it is casting back into the dim recesses of memory. These are the instructions I am following: the canonical UPGRADE.txt in every codebase of D7: api.drupal.org/api/drupal/UPGRADE.txt/7.x -- specifically items 13 and 14 of the "major version upgrade" section. As originally noted, the first thing I tried was to handcode the db connection, and then I get different error, indicating what appears to be a missing DB, which I assume is because the upgrade didn't happen.
    – john brush
    Commented Apr 14, 2023 at 18:32
  • Drupal Answers is a "one question at a time" site rather than a support forum. And those instructions say this, even for minor updates: "Copy the custom and site-specific entries from the backup you made into the new settings.php file. You will definitely need the lines giving the database information, and you will also want to copy in any other customizations you have added." This question is likely to be closed as lacking focus. Tables like main_something being missing suggests you have a table prefix configured.
    – mona lisa
    Commented Apr 14, 2023 at 19:04
  • Point #14 says: Make your settings.php file writeable, so that the update process can convert it to the format of Drupal 7.x. It is the update process that converts it to the Drupal 7 format, as long as the file is writable from the server.
    – avpaderno
    Commented Apr 14, 2023 at 19:12
  • As a side note, there is not a minor version upgrade and a major version upgrade. In Drupal terminology, passing from Drupal 6 to Drupal 7 is an upgrade. Major version upgrade just puts the emphasis on the fact that the major version number (the 7 in 7.95) changes (for example, passing from 6.38 to 7.95). If it is the minor version number that changes (for example, passing from 7.‎ㅤ34 to 7.ㅤ95), that is an update, not an minor version upgrade.
    – avpaderno
    Commented Apr 14, 2023 at 19:21

1 Answer 1

1

The script update.php ascertains whether settings.php is D6 or D7 based on whether the $databases array is set. If that array is set in any form, it will skip all code designed to work with Drupal 6 settings file, and will skip upgrading the database to Drupal 7.

In my case, integration with CiviCRM required a bit of a kludgy addition to the settings.php creating aliases for databases, and used the $databases variable to do it. This confused update.php.

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.