Support Forum

Upgrade to 5.1.2 failed

CH chucktho
chucktho
Member

I attempted to upgrade to 5.1.2.  The upgrade was aborted by Simple Press and the details below were provided:

Please copy the details below and include them on any support forum question you may have:

6624 – success

6637 – success

6650 – success

6663 – success

6689 – success

Warning: Invalid argument supplied for foreach() in D:dev.alarmsearch.comwordpresswp-contentpluginssimple-pressadminlibraryspa-support.php on line 466

Warning: Invalid argument supplied for foreach() in D:dev.alarmsearch.comwordpresswp-contentpluginssimple-pressadminlibraryspa-support.php on line 466

Warning: Invalid argument supplied for foreach() in D:dev.alarmsearch.comwordpresswp-contentpluginssimple-pressadminlibraryspa-support.php on line 466

Warning: Invalid argument supplied for foreach() in D:dev.alarmsearch.comwordpresswp-contentpluginssimple-pressadminlibraryspa-support.php on line 466

Warning: Invalid argument supplied for foreach() in D:dev.alarmsearch.comwordpresswp-contentpluginssimple-pressadminlibraryspa-support.php on line 466

Warning: Invalid argument supplied for foreach() in D:dev.alarmsearch.comwordpresswp-contentpluginssimple-pressadminlibraryspa-support.php on line 466
6702 – success

This is a WordPress Multisite running on a Windows server using IIS 6.

I have no idea where to begin trying to solve the problem.  Any help will be greatly appreciated.

39 Answers

New Answer

MP Mr Papa
Mr Papa
Member

what version did you upgrade from? 

IIS, hmmm wonder if thats part of the issue…   we had the problem couple versions ago but have resolved it – so we thought as we had multiple confirmations and no more happenings… but very few folks are stuck using IIS…

It appears you have lost all your permissions…

do you have a db backup from before the upgrade as recommended?  if so, would be interesting to try the upgrade again…

If not, you will need to go to Forum – permissions – reset permissions and rest your permissions to the default state… this will be easy if you do not customize any permissions…  if you made some changes, you will need to remake them… probably safest to deactivate your sp plugins too and then reactivate them to make sure they set up their permissions…

CH chucktho
chucktho
Member

I should have said this at the beginning of the post – sorry.

 I tried the Automatic Upgrade option several times and in every case it took me to a page which said that I had the latest WordPress version – nothing about SimplePress.  So I downloaded the newer SimplePress version and tried to install it.  Failed – “folder already exists”.  Looked on the SimplePress site for some direction regarding upgrading and couldn’t find anything.  DELETED the version I had and then tried to install the latest version and THAT IS WHEN I got the error messages included in the original post.

“what version did you upgrade from? ”  I don’t remember, but it was 5 something.

“do you have a db backup from before the upgrade as recommended?  if so, would be interesting to try the upgrade again…”  Yes, but I’m afraid it would cause more problems than it fixed.  It would take too long to go into it in detail, but a few weeks ago the hosting provider restored the site from his backup and totally hosed it.  Somehow his backup was incrementally adding files to the point that every plugin I’ve ever had and erased was back along with every version (13) of my theme files, etc.  Since he is also the client, I am STUCK using Windows.

“If not, you will need to go to Forum – permissions ”  I am not offered that option – only “Upgrade SimplePress”.

YS Yellow Swordfish
Yellow Swordfish
Member

The important thing we really need to know is what version you were on before. There are links to install and upgrade instructions (from both V4 and V5) on the page you downloaded the latest version from so I am not sure how you missed them.

but to try and understand where you are at we could do with the old version number you are trying to upgrade from. If you can get into the database then you could look at the sflog table which will tell you.

CH chucktho
chucktho
Member

Here’s what it says when I click the Upgrade button:

Upgrade Simple:Press From Version 4.5.1 to 5.1.2 – (Build 6401 to Build 8910)

Does that help?

YS Yellow Swordfish
Yellow Swordfish
Member

It does indeed.

So – when you continue ahead with the upgrade I assume it ends up with the mess you had at the first post – is that correct? I will continue as if that is the case…

My best guess is – and I am afraid it is a guest – is that you have an issue with the permissions data in your database. It is at that point that things are going awry.

If you are willing to accept the loss of your permission records then I can give you a small code change that can bypass that section and then afterwards we can fix the permissions back up – there is actually a tool in the manage Permissions admin panel to reset them back to the default.

The alternative is top try and sort out the data problem before you attempt the upgrade…

CH chucktho
chucktho
Member

I’m a complete neophyte and at a complete loss, so whichever way you think would be best is ok with me.  If I lose all the permissions, I guess I’ll just figure it out if we can’t get them back – I think there are only a couple dozen users.

Bear in mind that I am not a coder, so whatever it is you want me to change or add, please be very specific.

I really appreciate your help.

MP Mr Papa
Mr Papa
Member

I am not sure what code change Andy was thinking of, so will have to wait til AM for him to come back…

YS Yellow Swordfish
Yellow Swordfish
Member

OK – before you try this let’s include Steve (Mr Papa) who knows this code better than I – to check if he thinks this is the safest approach. So hold off until he posts as well.

Code file to change: /simple-press/sp-startup/install/sp-upgrade-support.php

Function to change starts on line 218 named: sp_convert_perms_to_auths()

Right at the bottom of the function is this segment of code:

# now we need to convert existing roles
$roles = spdb_table(SFROLES);
foreach ($roles as $role) {
    $actions = unserialize($role->role_actions);
    $new_actions = spa_convert_action_to_auth($actions);
    spdb_query("UPDATE ".SFROLES." SET role_actions='".serialize($new_actions)."' WHERE role_id=".$role->role_id);
}

which I am suggesting you change to:

# now we need to convert existing roles
$roles = spdb_table(SFROLES);
foreach ($roles as $role) {
    $actions = unserialize($role->role_actions);
    if( ! empty($actions)) {
        $new_actions = spa_convert_action_to_auth($actions);
        spdb_query("UPDATE ".SFROLES." SET role_actions='".serialize($new_actions)."' WHERE role_id=".$role->role_id);
    }
}

But as I say – let’s wait for Steve’s input before going ahead.

CH chucktho
chucktho
Member

Mr. Papa hasn’t weighed in on this yet.  I think maybe it got lost in the pile.  Since you said to wait for him, I haven’t tried your proposed solution yet.

MP Mr Papa
Mr Papa
Member

sorry, not sure what I am supposed to weigh in on… embarassed

guess I did miss this topic…

CH chucktho
chucktho
Member

We were hoping for your advice on Yellow Swordfish’s suggestion from 8/4 in this thread.  Thanks for your help.

YS Yellow Swordfish
Yellow Swordfish
Member

Well so was I. Sorry about that – I know he didn’t have much time last night.
I think you should go ahead and give this a try anyway. I feel comfortable with it.

CH chucktho
chucktho
Member

No joy.  I attempted the code changes you suggested and get the following:

Please copy the details below and include them on any support forum question you may have:

Parse error: syntax error, unexpected $end in D:dev.alarmsearch.comwordpresswp-contentpluginssimple-presssp-startupinstallsp-upgrade-support.php on line 411

– success

While we’re on this subject, I don’t know if I’m supposed to do a Network Upgrade or Upgrade the site Simple Press is on.  When I select Upgrade I’m given the choice.  I’ve tried it both ways without success.

YS Yellow Swordfish
Yellow Swordfish
Member

The code is good. Are you sure you got ALL of the lines including those last two closing braces? Best way is to click on the ‘raw code’ button and then copy from the popup window into your clipboard but you do need it all.