MyBB Community Forums

Full Version: Running upgrade from scripts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm upgrading my forum from 1.8.7 to latest. At the same time I'm upgrading the whole infrastructure (Linux, PHP, MySQL...), so I am preparing a new server and for the upgrade I intend to:

  1. put the old server in R/O mode
  2. make a DB extract
  3. inject the DB extract in the new server
  4. copy the file data (uploads, avatars...)
  5. run the migration procedure
  6. check that everything is fine
  7. change the DNS records to point to the new server
Steps 2 to 6 are going to be repeated several times while keeping the old forum running (until step 6 is successful) and to make sure this happens fast and is not subject to human errors I want to run everything as a single script so that on D-Day everything runs smoothly.

However the docs says that the upgrade must be run from the admin console.

So, is there a way to short-circuit this and run the upgrade offline (by calling the PHP adequately)? Or should I reverse-engineer the PHP and implement the same thing with direct SQL requests and shell commands?
(2019-12-26, 12:53 PM)Ofnuts Wrote: [ -> ](...)
However the docs says that the upgrade must be run from the admin console.
(...)

Where is the doc about saying that the upgrade must be run from the admin console?

BTW, read this Upgrade for MyBB 1.8: https://docs.mybb.com/1.8/install/upgrade/
(2019-12-26, 01:48 PM)noyle Wrote: [ -> ]
(2019-12-26, 12:53 PM)Ofnuts Wrote: [ -> ](...)
However the docs says that the upgrade must be run from the admin console.
(...)

Where is the doc about saying that the upgrade must be run from the admin console?

BTW, read this Upgrade for MyBB 1.8: https://docs.mybb.com/1.8/install/upgrade/

OK, not the admin console, but I still need to start a browser... and possibly have to answer questions, which is what I want to avoid.

Quote:Open your forum’s home page in your web browser and add /install/
to the URL. For example, www.yourdomain.com/install/ or
www.yourdomain.com/forum/install/
So what you need may be a CLI tool for managing the forum, its upgrade process and possibly other stuff, right?

Unfortunately, there's no such tool from official MyBB. And yes you need a browser to navigate to your forum URL with /install appended.

I you really need something like automatic/self upgrade, it won't be that hard for you, I think. Database operations are in ./install/resources/upgrade?.php files, you can directly require them in your own PHP script. The other three important processes are:
  • MyBB default theme/template install. Yes, the default theme usually gets installed in every upgrade.
  • Setting file refresh.
  • Cache rebuild & reload.
It's lucky that all above three processes are enclosed in ./install/upgrade.php.
Our plan is to provide a CLI for management purposes in a future release, but right now unfortunately both installs and upgrades currently need a browser.
Hmm. OK. I'll see if I can patch up something by using Curl in the scripts.