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 »

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
Kailey
Community Team Leader
Community Team Leader
Posts: 3738
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by Kailey »

Try this from the CLI: from your board's root, execute the following command php bin/phpbbcli.php --safe-mode db:migrate
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
My little corner of the world, where I sometimes post things documented from my job.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by 3Di »

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.
πŸ†“ Free support for our extensions also provided here: phpBB Studio
πŸš€ Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity ΒΊ PhpStorm's proud user ΒΊ Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
warmweer
Jr. Extension Validator
Posts: 11268
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by warmweer »

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.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
EA117
Registered User
Posts: 2159
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by EA117 »

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 32 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 »

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 »

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: 28654
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 »

In your config.php, replace mysql with mysqli, and run the command again
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 »

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
Kailey
Community Team Leader
Community Team Leader
Posts: 3738
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by Kailey »

Official docs says this one: php bin/phpbbcli.php --safe-mode db:migrate
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
My little corner of the world, where I sometimes post things documented from my job.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28654
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 »

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
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 »

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: 2159
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Upgrade 3.0.x to 3.2 using CLI

Post by EA117 »

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”