Upgrade 3.0.x to 3.2 using CLI

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
droberts
Registered User
Posts: 5
Joined: Thu Aug 15, 2019 11:33 pm

Upgrade 3.0.x to 3.2 using CLI

Post by droberts » Thu Aug 15, 2019 11:40 pm

I'm struggling a bit with a 3.0.x to 3.2.7 upgrade. I followed the various procedures for upgrading here in the support documentation and forums (notably here: https://www.phpbb.com/support/docs/en/3 ... /upgrade3/). Unfortunately, when I went to the /install directory using my browser and tried to upgrade, PHPBB complained about a scripting time limit being detected and said to upgrade via CLI. I tried invoking the phpbbcli.php script with "install" and it complains about needing a "config-file." I tried pointing it at the config.php that I copied from my pervious installation, but it looks like it wants a YAML file of some sort. There are lots of different YAML files in the config directory, but I'm not sure which one it might want. Any advice? I can't seem to find another support topic that might address this exact case and I don't want to bork up my database permanently (yes, I did make a 3.0 backup first, worst case) by fiddling. Thanks!

User avatar
kinerity
Community Team Member
Community Team Member
Posts: 2338
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by kinerity » Fri Aug 16, 2019 12:20 am

Try this from the CLI: from your board's root, execute the following command php bin/phpbbcli.php --safe-mode db:migrate
Kailey Truscott - Community Team

User avatar
3Di
Former Team Member
Posts: 14088
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by 3Di » Fri Aug 16, 2019 12:28 am

droberts wrote: ↑
Thu Aug 15, 2019 11:40 pm
I tried invoking the phpbbcli.php script with "install" and it complains about needing a "config-file." ... .... but it looks like it wants a YAML file of some sort.
Yes, there is a sample file in the docs folder.

install-config.sample.yml

But's to install a fresh board, not upgrade.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
warmweer
Registered User
Posts: 2688
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Upgrade 3.0.x to 3.2 using CLI

Post by warmweer » Fri Aug 16, 2019 5:59 am

droberts wrote: ↑
Thu Aug 15, 2019 11:40 pm
.... Unfortunately, when I went to the /install directory using my browser and tried to upgrade, PHPBB complained about a scripting time limit being detected and said to upgrade via CLI. I tried invoking the phpbbcli.php script with "install" and it complains about needing a "config-file." I tried pointing it at the config.php that I copied from my pervious installation, but it looks like it wants a YAML file of some sort. There are lots of different YAML files in the config directory, but I'm not sure which one it might want. Any advice? I can't seem to find another support topic that might address this exact case and I don't want to bork up my database permanently (yes, I did make a 3.0 backup first, worst case) by fiddling. Thanks!
No advice on CLI (I've never used it), but depending on how large your board it, it may still be possible to upgrade it the usual way on a personal webserver (on your PC) in which you can set (increase) the max_execution_time and max_input time.
If you don't have one set up yet (WAMP, DEVServer or similar), or have no experience then I'ld suggest usbWebserver (https://usbwebserver.yura.mk.ua/) 8.6.1 (php5.6) or 8.6.2 (php 7.1). Unpack and it's ready (configured) to use.
My board's not broken, it just went peculiar

User avatar
EA117
Registered User
Posts: 838
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by EA117 » Fri Aug 16, 2019 8:03 am

I've never done specifically a phpBB 3.0.x to phpBB 3.2.x update with it, but the attached configuration file is how I've triggered a database-only update from the command line before.

Note the phpbbcli.php to be invoking here is the one which exists in the phpBB /install directory, which has a different command set than the /bin/phpbbcli.php.

And because you're doing a database-only upgrade and not a full installation (since presumably you've already copied all the phpBB 3.2.7 files into place, and only need to update the still-3.0.x database to 3.2.7), you're looking to invoke the "update" command rather than "install".

So copy this update-config.db-only.yml file to the /install directory. Then change the current directory to the /install directory, and invoke the command line:

php phpbbcli.php update update-config.db-only.yml


I presume you were able to make it through the STK database cleanup first, as part of the overall Upgrading from 3.0 to 3.2 steps and approach.


Just to save anyone a click, the contents of this configuration file are:

Code: Select all

updater:
    type: db_only
    extensions: []
Attachments
update-config.db-only.yml
(46 Bytes) Downloaded 6 times

droberts
Registered User
Posts: 5
Joined: Thu Aug 15, 2019 11:33 pm

Re: Upgrade 3.0.x to 3.2 using CLI

Post by droberts » Fri Aug 16, 2019 4:36 pm

kinerity wrote: ↑
Fri Aug 16, 2019 12:20 am
Try this from the CLI: from your board's root, execute the following command php bin/phpbbcli.php --safe-mode db:migrate
I tried this and got:

Code: Select all

Fatal error: Uncaught Error: Call to undefined function phpbb\db\driver\mysql_query() in /.../phpbb/db/driver/mysql.php:189

droberts
Registered User
Posts: 5
Joined: Thu Aug 15, 2019 11:33 pm

Re: Upgrade 3.0.x to 3.2 using CLI

Post by droberts » Fri Aug 16, 2019 4:38 pm

EA117 wrote: ↑
Fri Aug 16, 2019 8:03 am
I've never done specifically a phpBB 3.0.x to phpBB 3.2.x update with it, but the attached configuration file is how I've triggered a database-only update from the command line before.

Note the phpbbcli.php to be invoking here is the one which exists in the phpBB /install directory, which has a different command set than the /bin/phpbbcli.php.

And because you're doing a database-only upgrade and not a full installation (since presumably you've already copied all the phpBB 3.2.7 files into place, and only need to update the still-3.0.x database to 3.2.7), you're looking to invoke the "update" command rather than "install".

So copy this update-config.db-only.yml file to the /install directory. Then change the current directory to the /install directory, and invoke the command line:

php phpbbcli.php update update-config.db-only.yml


I presume you were able to make it through the STK database cleanup first, as part of the overall Upgrading from 3.0 to 3.2 steps and approach.


Just to save anyone a click, the contents of this configuration file are:

Code: Select all

updater:
    type: db_only
    extensions: []
I tried this and got:

Code: Select all

Fatal error: Uncaught Error: Call to undefined function phpbb\db\driver\mysql_query() in /...<<forum path>>.../phpbb/db/driver/mysql.php:189

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25325
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by Paul » Fri Aug 16, 2019 7:09 pm

In your config.php, replace mysql with mysqli, and run the command again
Knock knock
Race condition
Who's there?

My Blog β€’ My Photos β€’ my phpBB Extensions β€’ custom phpBB work & Development

droberts
Registered User
Posts: 5
Joined: Thu Aug 15, 2019 11:33 pm

Re: Upgrade 3.0.x to 3.2 using CLI

Post by droberts » Fri Aug 16, 2019 8:47 pm

Paul wrote: ↑
Fri Aug 16, 2019 7:09 pm
In your config.php, replace mysql with mysqli, and run the command again
OK, will do. Which command (there were two, one in install/ and the other in bin/)? Or either one (do they do the same thing)?

User avatar
kinerity
Community Team Member
Community Team Member
Posts: 2338
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by kinerity » Sat Aug 17, 2019 1:33 am

Official docs says this one: php bin/phpbbcli.php --safe-mode db:migrate
Kailey Truscott - Community Team

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25325
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by Paul » Sat Aug 17, 2019 6:57 am

droberts wrote: ↑
Fri Aug 16, 2019 8:47 pm
Paul wrote: ↑
Fri Aug 16, 2019 7:09 pm
In your config.php, replace mysql with mysqli, and run the command again
OK, will do. Which command (there were two, one in install/ and the other in bin/)? Or either one (do they do the same thing)?
You should use the one from install/. The other one will not work for upgrading from 3.0 properly
Knock knock
Race condition
Who's there?

My Blog β€’ My Photos β€’ my phpBB Extensions β€’ custom phpBB work & Development

droberts
Registered User
Posts: 5
Joined: Thu Aug 15, 2019 11:33 pm

Re: Upgrade 3.0.x to 3.2 using CLI

Post by droberts » Sat Aug 17, 2019 5:02 pm

Paul wrote: ↑
Sat Aug 17, 2019 6:57 am
droberts wrote: ↑
Fri Aug 16, 2019 8:47 pm
Paul wrote: ↑
Fri Aug 16, 2019 7:09 pm
In your config.php, replace mysql with mysqli, and run the command again
OK, will do. Which command (there were two, one in install/ and the other in bin/)? Or either one (do they do the same thing)?
You should use the one from install/. The other one will not work for upgrading from 3.0 properly
That worked! Thanks for all your help, @Paul. Much appreciated. Thanks to everybody else who contributed feedback as well. If nothing else, I have a better appreciation for how phpBB works.

User avatar
EA117
Registered User
Posts: 838
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by EA117 » Sat Aug 17, 2019 7:37 pm

Paul wrote: ↑
Sat Aug 17, 2019 6:57 am
You should use the one from install/. The other one will not work for upgrading from 3.0 properly
Thanks for confirming; I couldn't really have said one way or the other. Truthfully I expected that the actual database migration result would have been the same in either case. If there was "something more" to invoking the actual installer/update code, I presumed it would be to benefit "something else" besides the database migration proper. Like the per-extension upgrade processing seen to be occurring, or just "other things the full interactive /install/app.php/update processing would have normally performed" in addition to "just" the actual database migration.

Has the https://www.phpbb.com/support/docs/en/3.2/ug/upgradeguide/upgrade3/ page always referred to php ./bin/phpbbcli.php db:migrate --safe-mode as the CLI alternative? It doesn't stick in my mind one way or the other. But if we think the /install/phpbbcli.php process may be necessary for this phpBB 3.0.x upgrade process, maybe its something we need a bug on to investigate and update the site document accordingly.

Post Reply

Return to β€œ[3.2.x] Support Forum”