Reverting 2.1.3 to 2.1.2

Started by nc3man, February 13, 2023, 02:15:54 PM

Previous topic - Next topic

nc3man

Due to a bug we've found with unwanted notification behavior, we wish to revert SMF 2.1.3 to 2.1.2. I have a backup to easily revert the files. Can we still use the 2.1.3 database or do I have to revert the DB backup as well? Since we only recently upgraded to 2.1.3, there are only about a half dozen new posts, so advice on how to revert to the 2.1.2 DB and then insert those half dozen posts from a 2.1.3 SQL dump to make it look seamless would be appreciated.

Diego Andrés

If you patched the forum from 2.1.2, simply uninstall the patch.

SMF Tricks - Free & Premium Responsive Themes for SMF.

nc3man

Quote from: Diego Andrés on February 13, 2023, 02:18:18 PMIf you patched the forum from 2.1.2, simply uninstall the patch.
Thanks, Diego. In the Package Manager, to the right of the "SMF 2.1.3 Update" line, there are 2 buttons, "LIST FILES" and "DELETE". Will selecting DELETE simply revert files and any DB records to 2.1.2, keeping all posts and customizations intact?

Kindred

No. Delete will just delete the mod package, you need to UNINSTALL
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

nc3man

#4
Where do I find the UNINSTALL option? Note that when I went to upgrade from 2.1.2 to 2.1.3 in the first place, the update link in the Package Manager was nil (did nothing when I clicked on it), so I manually downloaded smf_2-1-3_patch.tar.gz from https://custom.simplemachines.org/index.php?action=patches. Will that make a push button UNINSTALL not available? I don't see anywhere to do that.

DeadMan...

1. If installed the update as a package, it should also have an Uninstall button next to the list files and delete buttons.

2. If you backed up all the files, did you include backing up the database before running the update?
I tell it how I see it... Don't like it? Hit Alt+F4!

nc3man

#6
I always backup both files and database before any upgrade. This is the view I have. No UNINSTALL button, and the 2.1.3 update shows 3 times because, since I updated manually it still thinks I need to upgrade, despite that the footer shows 2.1.3 and if I click that update link which now works, it just tells me "This update is already installed." Those 2 extra clicks trying that evidently gives me 3 identical rows showing the update occurred a couple weeks ago.You cannot view this attachment.

nc3man

I hate to fork a tangent question, but how can it be that the Package Manager "thinks" I have the wrong version, but the footer bar clearly shows the current version at 2.1.3, which I can also observe if I peak into the raw DB? For grins, I clicked on that "update your forum" link one more time, it tells me not to proceed because the version is correct, and now I have FOUR identical lines of "SMF 2.1.3 Update" listed in Modification packages in the Pkg Mgr. I would think that grabbing the packages from the official location as I did and executing the install would work just as well as the "update your forum" link, but it evidently is a horse of a different color.

Back to the subject, I still want to revert to 2.1.2 if possible and almost am ready to just restore the 2 week old configuration and notify the users whose posts disappear that they should post anew if they like. The longer I wait that option becomes less desirable, but I hate to have notifications boggled.

Sir Osis of Liver

You can try marking the 2.1.3 patch installed using fix_packages.php, package manager should then display an uninstall button. 

https://download.simplemachines.org/index.php?tools
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

nc3man

Quote from: Sir Osis of Liver on February 13, 2023, 07:53:58 PMYou can try marking the 2.1.3 patch installed using fix_packages.php, package manager should then display an uninstall button. 

https://download.simplemachines.org/index.php?tools
I didn't realize a tool had been written to possibly resolve this. What is the best way to run this? Can I simply upload to our SMF root and then run https://{SMF_ROOT}/package.php. Is it recommended to set
$context['override_security'] = true;and then delete the file afterwards? If there is a little more documentation on this, I'm happy to read.
Thanks!

Sir Osis of Liver

Just upload the file to forum root and run it with direct link.  You shouldn't have to make any code changes.  It will load displaying installed mods with option to uninstall.  Click on [Show uninstalled], you should see the 2.1.3 patch.  Mark it installed.  May or may not work, worth a try.
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

nc3man

Quote from: Sir Osis of Liver on February 13, 2023, 08:47:46 PMJust upload the file to forum root and run it with direct link.  You shouldn't have to make any code changes.  It will load displaying installed mods with option to uninstall.  Click on [Show uninstalled], you should see the 2.1.3 patch.  Mark it installed.  May or may not work, worth a try.

That did not work. I'm guessing fix_packages.php needs an update. When I load it, I get a number of deprecated messages
Deprecated: Function create_function() is deprecated in /home2/northco1/public_html/smf/fix_packages.php on line 189
Deprecated: Function create_function() is deprecated in /home2/northco1/public_html/smf/fix_packages.php on line 198
Warning: Parameter 1 to __lambda_func() expected to be a reference, value given in /home2/northco1/public_html/smf/Sources/Subs-List.php on line 164
Nevertheless, it "seemed" to be working. However, SMF 2.1.3 initially showed as installed, so I chose to mark it uninstalled, then proceed to show installed, marked it, and then marked it Installed. No change at all to what I see in the Package Manager. There was also an error log entry which may indicate not much happened.
Critical error /home2/northco1/public_html/smf/Sources/Load.php (Line 426)
JSON decode error: Syntax error, malformed JSON
We are running PHP 7.4 and I'm guessing that fix_packages.php may need some fixing. It was worth a try and I'm still game for suggestions. Thanks

Sir Osis of Liver

fix_packages.php works fine in php 7.4.  I also get the JSON decode error, but it doesn't affect functionality.  Don't know if it's been updated recently, but it's always worked whenever I've used it.

Just tried it again.  If I take an installed mod (2.1.3) and mark it uninstalled, package manager replaces the Uninstall button with Install button.  If I mark an uninstalled mod as installed, Install button is replaced with Uninstall, which works but shows all files not found. 

Are you able to get an Uninstall button?
 
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

nc3man

Unfortunately, I was never able to get an UNINSTALL button. Thanks for all the advice, though! I at least know of some extra tools should I run down a rabbit hole again in the future.

Sir Osis of Liver

Here's something you can try.  First, make sure smf_2-1-3_patch.tar.gz is in /Packages directory.  Then go into your database and find id_install for that file in _log_packages table, install_state should be 1.  Then try linking to uninstall directly -

/index.php?action=admin;area=packages;sa=uninstall;package=smf_2-1-3_patch.tar.gz;pid=2

pid will be id_install for that file in your database.
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

nc3man

#15
Thanks to all the mavens who have made some good suggestions to solve my issue, which is not only the 2.1.3 notifications bug, but something bolluxed along my journey of updates from 2.0.x all the way to 2.1.3. Not sure this is yet again some other 2.1.3 bug or just some artifact of my using SMF since 2007 and updating in place, along with a few customizations I've made along the way, making my issue with not having an UNINSTALL option unique to me. Not to worry as I can deal with it and always have backups before any SMF update.

To avoid folks wasting any more time on this, I just bit the bullet and restored my working 2.1.2 files and DB. All is good and notifications are again working when a topic and corresponding board are both set for emails and alerts. I notified the few users that their recent posts have disappeared. Thanks all for your efforts. I will mark this solved.

nc3man

Quote from: Sir Osis of Liver on February 14, 2023, 03:18:34 PM...Then try linking to uninstall directly -
/index.php?action=admin;area=packages;sa=uninstall;package=smf_2-1-3_patch.tar.gz;pid=2
That may have done the trick but I had done the brute force revert just prior to receiving this. Thanks for really diving into this and I may have good use of this thread for dealing with Pkg Mgr anomalies in the future.

Sir Osis of Liver

You can try upgrading again when 2.1.4 is released.  Shouldn't be a problem if 2.1.3 installs correctly.
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

Advertisement: