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

Afraid I've seriously messed up my EE install after a large 2.x to 7.x upgrade

How Do I?

Phil J Leitch's avatar
Phil J Leitch
92 posts
10 months ago
Phil J Leitch's avatar Phil J Leitch

getting this message when I try to login to the cp: Your system folder path does not appear to be set correctly. Please open the following file and correct this: admin.php

yahtzeen.com is the main site

ralphscorner.com is second msm site

donk3y is the system folder

previous to the upgrade the CP was working fine but yahtzeen.com was not viewable. ralphscorner.com was working fine.

so in my infinite wisdom I thought “oh I should upgrade my EE install”.

attached is the index and admin files of the yahtzeen.com directory and the directory structure.

am I overlooking a simple mistake or did I totally destroy my sites?

       
Phil J Leitch's avatar
Phil J Leitch
92 posts
10 months ago
Phil J Leitch's avatar Phil J Leitch

ugh. ignore this post…hha

       
Bryan's avatar
Bryan
16 posts
10 months ago
Bryan's avatar Bryan

Can you try changing your system_path in index.php and admin.php to

$system_path = './donk3y';

I think that should work

       
Phil J Leitch's avatar
Phil J Leitch
92 posts
10 months ago
Phil J Leitch's avatar Phil J Leitch

well it at least gave me a different error message so woo!

new message: Error: Site Error: Unable to Load Site Preferences from the Database; No Preferences Found

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
10 months ago
Robin Sowell's avatar Robin Sowell

So going from 2 to 7 can be rather a lot! I usually try to go from 2->lastest 2->3. And then I may go 3->7. But it’s also fun to just charge full speed ahead sometimes, so we can likely make it work.

You’ve - got a backup of the database from before you started- yes? If so, then worst case, redo it the slow way.

What version of PHP are you running? at least 7.0, yes? You’ll want that- 7.4+ preferable.

OK- all that in place, you can work through this.

‘Unable to Load Site Preferences from the Database’ - is that frontend and backend? On the frontend, could just be you have the site name wrong in your index.php file- if you replaced those and you’ve got msm, it’s possible. Here’s what’s failing:

public function site_prefs($site_name, $site_id = 1, $mutating = true)
    {
        // ee()->config is loaded before ee()->db, but the site_prefs() all happens after ee()->db
        // is loaded, so we do this check here instead of in _initialize().
        if (! array_key_exists('multiple_sites_enabled', $this->default_ini) && ee()->db->table_exists('config')) {
            $msm = ee('Model')->get('Config')
                ->filter('site_id', 0)
                ->filter('key', 'multiple_sites_enabled')
                ->first();

            if ($msm) {
                $this->default_ini[$msm->key] = $msm->value;
            }
        }

        if (! isset($this->default_ini['multiple_sites_enabled']) or $this->default_ini['multiple_sites_enabled'] != 'y') {
            $site_name = '';
            $site_id = 1;
        }

        if ($site_name != '') {
            $query = ee()->db->get_where('sites', array('site_name' => $site_name));
        } else {
            $query = ee()->db->get_where('sites', array('site_id' => $site_id));
        }

        if (empty($query) or $query->num_rows() == 0) {
            if ($site_name == '' && $site_id != 1) {
                $this->site_prefs('', 1);

                return;
            }

            show_error("Site Error:  Unable to Load Site Preferences from the Database; No Preferences Found", 503);
        }

It’s trying to query the exp_sites table and pull back the preferrences for the correct site. If you have a site name set- check your index.php page your admin.php page and your config.php - it’s going to use that. Look in your database- do you have that all matched up? If you don’t have a site name, it’s going to default to site_id 1. Try and sort that out.

Couple of things that will also be a big help.

1 just set errors to show to everyone- I’d just go to your index.php and change:

$debug = 1;

Same in admin.php. Basically- you want to see the errors.

And- I’d turn on error logging.

In system/user/config/config.php add:

$config['log_threshold'] = '1';
$config['log_date_format'] = 'Y-m-d H:i:s';

And make a writable folder in system/user called ‘logs’.

Those will help see what’s going on.

And if you get really stuck? This would be a good case for getting on a support plan- you can just sign up and then cancel and have it the full month.

But it’s all nothing that can’t be fixed. Hopefully with a backup database, though!

       
Tom Jaeger's avatar
Tom Jaeger
449 posts
10 months ago
Tom Jaeger's avatar Tom Jaeger

Lot of great stuff from Robin :D

Right off the bat, i’d check the config file and confirm your database connection details are accurate… As Robin said, you may need to jump PHP versions as well

Few other thoughts on this front.

  1. it might not be a bad idea to disable extensions in your config file
$config['allow_extensions'] = 'n';
  1. If you haven’t dropped in the new add-ons on the EE 7 version, I’d go ahead drop them in as well.

Cheers!

-Tom Jaeger

       
Phil J Leitch's avatar
Phil J Leitch
92 posts
10 months ago
Phil J Leitch's avatar Phil J Leitch

Thank you for these suggestions!

I will see what I can do with them over the weekend and post an update.

       
Phil J Leitch's avatar
Phil J Leitch
92 posts
9 months ago
Phil J Leitch's avatar Phil J Leitch

a month later i finally return to this and….

<DRUMROLL>

A few hiccups along the way but it’s working again!!!!

Thank you so so so so so so much Tom, Robin and Bryan!!!

       

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.