Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => SMF Feedback and Discussion => Topic started by: Sir Osis of Liver on May 17, 2012, 12:17:45 AM

Title: Improving upgrade for krappy hosts
Post by: Sir Osis of Liver on May 17, 2012, 12:17:45 AM
Took me a week to upgrade a clean 1.1.12 install to 2.0.2.  >:(  Forum is running on GoDaddy, has a 110mb database, no mods or custom edits.  Upgrade would quit after creating first backup table.  Disabled admin login, and was able to get almost halfway through it before it krapped out, again and again.  Tried upgrading from 1.1.12 to 1.1.16.  Got the 'paused to avoid overloading your server' message a number of times, but was able to complete the upgrade successfully by clicking 'Continue'.

Why does .16 upgrade work, and 2.0.2 upgrade doesn't?  ???

Because 2.0.2 upgrade.php is NEW and IMPROVED - it has an automatic countdown function that continues a 'paused' upgrade after several seconds (3, I think).  Seems like a good idea, but what if the database server is bogged down for more than 3 seconds (a lot more)?  Yep, the upgrade fails.  :(

Tried increasing setTimeout("doAutoSubmit() from 1000 to 5000, but that didn't work.  Ended up removing function doAutoSubmit() altogether, and that makes the upgrade run like .16 - it pauses when the db server falls behind, then sits patiently until you click 'Continue'.  Was then able to nudge the upgrade to completion by manually clicking 'Continue', dozens of times through the longer steps - a huge pain in the ass, but in the end upgrade was successful.

Yes, I know GoDaddy is a krappy host, but they promote SMF by offering it as an option to their (too) many accounts, and a lot of SMF forums run on their krappy servers.  This problem probably occurs on other krappy discount hosts.

Would it be terribly difficult to somehow coordinate upgrade.php with the db servers so upgrade can proceed at a pace that is comfortable for both?  The upgrade script obviously knows when the server is falling behind, but it doesn't seem to know when it catches up and is ready to continue, and the AutoSubmit overruns the server and buggers the upgrade.

[/rant]  :P

Title: Re: Improving upgrade for krappy hosts
Post by: emanuele on May 17, 2012, 04:12:19 AM
Quote from: Krash. on May 17, 2012, 12:17:45 AM
Because 2.0.2 upgrade.php is NEW and IMPROVED - it has an automatic countdown function that continues a 'paused' upgrade after several seconds (3, I think).  Seems like a good idea, but what if the database server is bogged down for more than 3 seconds (a lot more)?  Yep, the upgrade fails.  :(
I did several upgrades from 1.1.x to 2.0.x where the database was rather big and of course the upgrade paused...and resumed after the 3 seconds...
So, the real question is why does the script stop instead of resuming the upgrade?

Quote from: Krash. on May 17, 2012, 12:17:45 AM
Tried increasing setTimeout("doAutoSubmit() from 1000 to 5000, but that didn't work.  Ended up removing function doAutoSubmit() altogether, and that makes the upgrade run like .16 - it pauses when the db server falls behind, then sits patiently until you click 'Continue'.  Was then able to nudge the upgrade to completion by manually clicking 'Continue', dozens of times through the longer steps - a huge pain in the ass, but in the end upgrade was successful.
Reading this it seems to me that you had a problem with the javascript.
Do you have the possibility to test again the script to see if there is any javascript error?
Title: Re: Improving upgrade for krappy hosts
Post by: Kindred on May 17, 2012, 08:49:51 AM
hmmm....   I did the upgrade on a database of over 2.5 GB...   that "timeout" was way more than 3 seconds, but it still correctly picked up afterwards.
Title: Re: Improving upgrade for krappy hosts
Post by: Sir Osis of Liver on May 17, 2012, 05:30:46 PM

I did a 2.0 upgrade a year or so ago on another GoDaddy account, and didn't have any problems, but this one was a mess.  I'm going to revert it back to 1.1.12 and try again, to confirm that the hack works consistently before I use it on the live forum.  Can't play with it now, one of my other guys got hacked and have to fix that first.

Title: Re: Improving upgrade for krappy hosts
Post by: Sir Osis of Liver on May 21, 2012, 01:15:10 AM
Ok, just getting back to this.  Ran three 2.0.2 upgrades with the modified script (manual continue), all on GoDaddy:

1 - from 2.0 with a 6mb database.  Paused three times, then finished successfully on first attempt.

2 - from 1.1.12 with 110mb db (test forum).  Paused dozens of times, mostly when renaming columns and doing the tinytext thing, completed successfully first attempt.

3 - from 1.1.12 with 110mb (live forum).  Paused dozens of times, mostly when renaming columns and doing the tinytext thing, and failed completely first three attempts due to internal server errors, but finally completed, and miraculously, the db appears to be intact.

2 & 3 are on the same server, same account, different subdirs.  Not even a little bit surprised that GoDaddy saved the worst for the live forum.  :P