Jump to content
thirty bees forum

The big upgrader-upgrade


Recommended Posts

Over the last couple of days I've put together many small patches and enhancements for the tbupgrader module. This is obviously a pretty crucial module, so I think it's a good idea if a few more people than just me test it.

How to test

  1. Move the current module aside, out of the modules/ folder.
  2. Download this ZIP https://github.com/Traumflug/tbupdater/archive/supercollection.zip and place its content inside the modules/ folder.
  3. rename the resulting folder from tbupdater-supercollection to tbupdater.

All this is reversible, of course.

What's new

  • Fixed graphics glitches for window sizes between ~900 and ~1200 pixels (bootstrap md and lg).
  • Should work better on Windows now, thanks to @musicmaster .
  • Backups should actually work now, also thanks to @musicmaster . No longer these 12 million files to backup messages (which actually started over in case one waited that long). It should show the actual number of files now and finish as all of them are backed up.
  • Panels on the module page should now be in a more logical order. Update options above the "Update" button, for example. I've heard we Westerners have the habit to read from top to bottom, so seeing options after clicking the button is a bit late.
  • Database backup now working as well, again, thanks to @musicmaster.
  • Some 1500 lines of unused, duplicate code removed. Just occupying disk space and confusing developers.
  • And last not least, one can download files manually now in case automatic downloads fail.

0_1509659003318_Bildschirmfoto am 2017-11-02 um 22.39.28-fullpage.png

Link to comment
Share on other sites

My setup is "fullscreen is a waste" :-)

Anyways. Just pushed another commit onto this branch which should fix these glitches: https://github.com/Traumflug/tbupdater/commit/0d0dc449fc6cb62da5ea543dabf68c8a619a34b7

URL for downloading the module ZIP stays the same; procedure for installation, too.

Link to comment
Share on other sites

@Traumflug is it possible to allow backups if an update is not available?

Updater used to have this option before it backed up 12 million files ;)

Was so excited to see this especially the parts added by @musicmaster so I just installed it hoping to do the backups like I used to months back.

But the update button doesn't work if you are current so I couldn't test it out :(

0_1509899848040_Screen Shot 2017-11-05 at 11.35.27 AM.png

Please? :pray:

Link to comment
Share on other sites

But the update button doesn’t work if you are current

This is intended behavior :-)

But I see your point, not only for a module test run. Merchants may want to refresh their installation, for example after they changed code manually. I'll see what I can do about it.

If you can't wait, you can fake the installed version in config/settings.inc.php line 14. That's where the current version is defined, just change it with a text editor.

Like changing PHP define('_TB_VERSION_', '1.0.3'); to PHP define('_TB_VERSION_', '1.0.2');

Link to comment
Share on other sites

@Traumflug intended behavior yes! :) :) :) But think I might wait!

See? if I had a roll back I'd go for it but since going live I'm not inclined to mess with anything even though I have a cpanel backup :)

I used that rollback option all the time when I first installed TB when the button worked.

Then it started the million file thing and didn't backup/rollback anymore until button no longer worked for current version like now :(

This was actually the best part of thirty bees for me!

A built in back up that didn't require cpanel when you first install it and are learning how to do everything! :)

Opps....that was a mistake...rollback....all better!

Honestly, if I had not had the rollback option to fix my mistakes in the beginning I probably would have bailed out of frustration!

Link to comment
Share on other sites

As promised, I looked into these refresh-upgrades. It's not easily implementable. Upgrading doesn't mean to simply unpack a ZIP file, it's handled file by file along a list of file actions. And there is no list of actions for a refresh.

Nevertheless, this research triggered quite a chunk of additional commits. Things more tidy now, (hopefully) more understandable messages. Temporary files get removed after being done. And this "warning notifications have been found" HOAX on the final screen removed, there is no code which could issue such warnings.

I can also confirm that faking the version (currently) leads to backups. However, the backup thing built into the upgrader module means to allow version rollbacks, not fixing broken installations.

cPanel (or file copying or another backup tool) backups are better because they can be restored with a broken shop installation, too. Being able to restore a broken installation is pretty much the point of backups, isn't it?

Here's the now prettified final screen:

0_1510176123452_Bildschirmfoto von »2017-11-08 22-19-28«.png

Link to comment
Share on other sites

Huh? Didn't mean to cause trouble. No other backup tool, @alwayspaws ?

Imagine the shop gets broken for some reason. Pages no longer load or simply show some mess. This makes the upgrader module, including its nice rollback button, inaccessible. How would one restore from the backup done with the upgrader module, then? It might be possible, but it's certainly not easy.

A much better idea is to do a database backup (Backoffice -> Advanced Parameters -> DB Backup), then to download all the files via FTP. This way one can restore when restoring is actually needed: remove the broken garbage, then upload all the files. If the database got broken, too, use phpMyAdmin to restore from the backup in adminXXX/backups.

Link to comment
Share on other sites

@alwayspaws doomed why? :)

ROLLBACK IS A GOOD THING :fireworks:

Thanks SO MUCH @Traumflug for spending your valuable time on this.

I'm trying it now downloaded from this link: https://github.com/Traumflug/tbupdater

Button is live but when I click on it no activity log screen?

Double checking I installed correctly...

Link to comment
Share on other sites

@alwayspaws I'm waiting to renew my hosting to add the easy backup options they offer but they couldn't sell it to me monthly until my current plan expired!

I do the manual cpanel zip file and db backup in TB but the quick rollback was the best thing ever when I was first setting up my store!

After seeing what you do with csv files this you can do no problem! It's just a module!

Recharge and revisit :)

Link to comment
Share on other sites

Hmm downloaded from supercollection branch from your new link deleted all the others in cpanel and I can't click update button now?

Think I need my own advice Recharge and revisit :)

Thanks I'll try again later maybe someone else will install in the mean time and report on the rollback feature!

@traumflug said in The big upgrader-upgrade:

@vzex

I’m trying it now downloaded from this link: https://github.com/Traumflug/tbupdater

You have to switch to the supercollection branch:

https://github.com/Traumflug/tbupdater/tree/supercollection

Link to comment
Share on other sites

@vzex

but the quick rollback was the best thing ever when I was first setting up my store!

Do I read here you use such rollbacks if editing code files didn't work out as expected?

I can’t click update button now?

After lowering the version in settings.inc.php the panel with the update button should look like this:

0_1510180694868_Bildschirmfoto von »2017-11-08 23-36-14«.png

Note that 1.0.2 above and 1.0.3 in the lower text differ. In case the update button is still disabled, please add a screenshot here.

Link to comment
Share on other sites

Looks ok.

One addition for db.php: The function executeS() contains the Tools::displayError() too. It too should be replaced with echo.

Contrary to its name Tools::displayError does not display anything. It just returns the value that you give it after processing it with htmlentitiesUTF8(). Elsewhere in the code you see things like "die(Tools::displayError($msg))". It is used in several other places in Db.php too and I propose to replace them all.

Note that the main db.php (not of the tbupdater module) uses the throw command. Unfortunately it is not easy to use the main classes in the updater module as the updater module uses a special namespace.

Link to comment
Share on other sites

One addition for db.php: The function executeS() contains the Tools::displayError() too. It too should be replaced with echo.

Done: https://github.com/thirtybees/tbupdater/pull/11/commits/c7e7f29a3b2024edaf16886120e80520a2a1b6f2

Choosed the die() route, because in all these places, Tools::displayError() was followed by an exit().

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...