We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Upgrade from version 2 to version 3 gives error "You must define the following database parameters: database"

How Do I?

NeilC's avatar
NeilC
24 posts
about 5 years ago
NeilC's avatar NeilC

This doesn’t appear to be an uncommon error, however I’ve tried suggestions from the years old threads and they are not working.

I followed steps outlined here: https://docs.expressionengine.com/v3/installation/upgrade_from_2.x.html

Specifically:

  1. Backed up the site

  2. Set the site to offline (copied and renamed offline.html to index.html)

  3. Copied config.php and database.php to their locations in the v3 system folder

  4. Renamed secret_system to secret_system_old

  5. Renamed themes to themes_old

  6. Renamed index.php to index.php.old

  7. Renamed secret_admin.php to secret_admin.php.old

  8. Uploaded v3 system, themes, index.php, and admin.php

  9. Renamed the new system to secret_system

  10. Renamed admin.php to secret_admin.php

  11. Edited index.php and secret_admin.php to point to secret_system

  12. Checked permissions as instructed, and they matched the old site

  13. Browsed to http://www.chosen-voice.com/secret_admin.php

Got the error:

Exception Caught

You must define the following database parameters: database

DBConfig.php:157

Tried renaming system and admin.php back to defaults and updating the settings in index and admin accordingly. Same result.

Tried making permissions less restrictive. Only difference was the error gave the full path to the file: ee/EllisLab/ExpressionEngine/Service/Database/DBConfig.php:157

Can anyone help me?

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
about 5 years ago
Robin Sowell's avatar Robin Sowell

I wonder if it’s not ‘seeing’ that you’re upgrading. So it’s just trying to run the control panel, and of course that breaks because the database config isn’t where it thinks it is.

Let’s go force it to run the update. In system/ee/EllisLab/ExpressionEngine/Boot/boot.php around line 71 look for something like:

use EllisLab\ExpressionEngine\Core;
 if (defined('REQ') && REQ == 'CP' && is_dir(SYSPATH.'ee/installer/'))
 {
  $core = new Core\Installer();
 }

We want it using that new Core\Installer(); So- let’s force it.

if (TRUE)
 {
  $core = new Core\Installer();
 }

See if the updater comes up and runs. I’d say 95% chance that’s it.

After it’s done, you’ll need to switch it back.

👍 1
       
NeilC's avatar
NeilC
24 posts
about 5 years ago
NeilC's avatar NeilC

Thank you so much, Robin. That worked! When I looked at the code that was there, it actually said…

if (FALSE && defined(‘REQ’) && REQ == ‘CP’ && is_dir(SYSPATH.’ee/installer/’))

so it seems to me that the “FALSE &&” caused the problem and should not be there. I put the line back the way it was, but would you agree that I should remove that “FALSE &&” text?

Then it’s on to upgrading the rest of the way, which I hope will go more smoothly.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
about 5 years ago
Robin Sowell's avatar Robin Sowell

Yes, you can permanently remove the FALSE and you should be good to go.

Did you download from github? I believe that’s some code that would be stripped by the build script before release- but made it easy for developers to force the upgrade on/off.

And soon that code will be replaced by v5 in any case! Glad to help- I’ll see if I can nail down why it’s still in there.

👍 1
       
NeilC's avatar
NeilC
24 posts
about 5 years ago
NeilC's avatar NeilC

Thank you, Robin. Yes, githup seemed to be the only way to get that software anymore. After the success, I found the thing about the FALSE in the readme file. I know I know, but I thought that since I was following instructions, I didn’t need to look for readme files as well. 🤦‍♂️

I have now upgraded all the way to version 5.3.2 without further incident. Hooray! 🥳

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.