Managing phpbb via CLI

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Anti-Spam Guide
hiran
Registered User
Posts: 25
Joined: Sun Mar 03, 2024 10:14 pm

Re: Managing phpbb via CLI

Post by hiran »

hiran wrote: Sun Mar 31, 2024 12:35 am
warmweer wrote: Thu Mar 21, 2024 9:03 am There's no need for CLI.
You can easily use the ACP to configure your users (I suspect you're referring to the permissions)
That's the point: I do not want to manually configure users. Instead I want to script the setup. But how would you add users if you cannot even check whether the user already exists or has been created successfully?
So to list users (something that I'd expect the CLI would do) you can execute

Code: Select all

mariadb -e "select username from phpbb_users;[ phpbb/code]
hiran
Registered User
Posts: 25
Joined: Sun Mar 03, 2024 10:14 pm

Re: Managing phpbb via CLI

Post by hiran »

danieltj wrote: Fri Mar 22, 2024 3:10 pm
And with my two other posts I now believe you are right: the CLI is not mature. To administrate phpbb one either has to use the UI or dig into PHP files and the database.
Last edited by Mick on Tue Apr 02, 2024 8:05 am, edited 1 time in total.
Reason: Removed unnecessary full multiple quotes.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26791
Joined: Fri Aug 29, 2008 9:49 am

Re: Managing phpbb via CLI

Post by Mick »

You don’t need CLI at all to administrate phpBB.
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
User avatar
warmweer
Jr. Extension Validator
Posts: 11623
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Managing phpbb via CLI

Post by warmweer »

hiran wrote: Tue Apr 02, 2024 7:05 am ...

So the list function I was expecting to find could be as simple as

Code: Select all

mariadb -e "select * from phpbb_config" phpbb
Alternatively add this list of parameters to the documentation.
CLI is for advanced users who know (and thoroughly understand) what they are doing.

Basically the above gives you a list of the entries in the config_table which can be done using a database management program e.g. phpMyAdmin, Adminer or even with Access (just link the tables into an Access database)

Perhaps phpBB API Documentation is what you are looking for.
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.
hiran
Registered User
Posts: 25
Joined: Sun Mar 03, 2024 10:14 pm

Re: Managing phpbb via CLI

Post by hiran »

warmweer wrote: Tue Apr 02, 2024 8:01 am CLI is for advanced users who know (and thoroughly understand) what they are doing.

Basically the above gives you a list of the entries in the config_table which can be done using a database management program e.g. phpMyAdmin, Adminer or even with Access (just link the tables into an Access database)

Perhaps phpBB API Documentation is what you are looking for.
I want to understand what I am doing. But I do not believe reverse-engineering the database structure or becoming a PHP developer should be part of administrating phpbb. These are different levels of abstraction.

For example, I understand how to install and upgrade extensions:
Day one: I unzip the extension in the correct folder, then activate and configure it via the ACP.
Day two: I just want to upgrade to the latest code. The settings in the control panel have already been done, so I want to script it - and it's not too difficult:

- use the CLI to deactivate the extension
- remove the extension folder
- unzip the new extension into the removed folder
- use the CLI to activate the extension

In that example I made use of the CLI to prevent that I have to understand the internals of phpbb and do not have to touch php code or run SQL statements myself.

That is my view, and despite I am a newbie on phpbb I have seen such patterns on other systems. If you believe the cli is for advanced users only your idea of advanced differs from mine.
hiran
Registered User
Posts: 25
Joined: Sun Mar 03, 2024 10:14 pm

Re: Managing phpbb via CLI

Post by hiran »

Mick wrote: Tue Apr 02, 2024 7:58 am You don’t need CLI at all to administrate phpBB.
Unfortunately that was not my question. It is part of the product, I want to use it and the question is just 'how'.
Is there documentation how to administrate phpbb without the CLI but still in a scriptable way?
User avatar
warmweer
Jr. Extension Validator
Posts: 11623
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Managing phpbb via CLI

Post by warmweer »

hiran wrote: Tue Apr 02, 2024 8:53 am ...
Is there documentation how to administrate phpbb without the CLI but still in a scriptable way?
OK, maybe https://area51.phpbb.com/docs/dev/3.3.x ... arted.html could be of use.

BTW: this was the first hit with google search for managing phpbb using CLI :idea:
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.
hiran
Registered User
Posts: 25
Joined: Sun Mar 03, 2024 10:14 pm

Re: Managing phpbb via CLI

Post by hiran »

warmweer wrote: Tue Apr 02, 2024 9:23 am
hiran wrote: Tue Apr 02, 2024 8:53 am ...
Is there documentation how to administrate phpbb without the CLI but still in a scriptable way?
OK, maybe https://area51.phpbb.com/docs/dev/3.3.x ... arted.html could be of use.

BTW: this was the first hit with google search for managing phpbb using CLI :idea:
Thank you! :D
Yes, this is much more what I was asking for. :D
It works for installing and seems to be a different CLI than the one I was using so far.

But: Can it work for updates? What I have seen is that phpbb recommends the install folder to be deleted for normal operation. Would I have to restore the install folder to perform updates?
User avatar
warmweer
Jr. Extension Validator
Posts: 11623
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Managing phpbb via CLI

Post by warmweer »

hiran wrote: Tue Apr 02, 2024 9:57 am Would I have to restore the install folder to perform updates?
Without the install folder you cannot update/upgrade phpBB.
As to updating extensions/styles/languages: no (root/) install folder needed.
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
Mick
Support Team Member
Support Team Member
Posts: 26791
Joined: Fri Aug 29, 2008 9:49 am

Re: Managing phpbb via CLI

Post by Mick »

A one click ACP update is on it’s way some time in the future https://tracker.phpbb.com/browse/PHPBB3-15851
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
hiran
Registered User
Posts: 25
Joined: Sun Mar 03, 2024 10:14 pm

Re: Managing phpbb via CLI

Post by hiran »

warmweer wrote: Tue Apr 02, 2024 10:09 am
hiran wrote: Tue Apr 02, 2024 9:57 am Would I have to restore the install folder to perform updates?
Without the install folder you cannot update/upgrade phpBB.
As to updating extensions/styles/languages: no (root/) install folder needed.
What is the recommended way to handle the install folder, if I need it for installation and for upgrades but must not have it during normal operation.
Rename? Set privileges? Delete and restore? Or something entirely else?
hiran
Registered User
Posts: 25
Joined: Sun Mar 03, 2024 10:14 pm

Re: Managing phpbb via CLI

Post by hiran »

Mick wrote: Tue Apr 02, 2024 10:28 am A one click ACP update is on it’s way some time in the future https://tracker.phpbb.com/browse/PHPBB3-15851
For sure that is nice to have. But I prefer something scriptable.
Think of automated operation, which helps both with many phpbb installations as with very few. In one case I cannot do it manually, in the other I do not want to remember how it is done.
User avatar
warmweer
Jr. Extension Validator
Posts: 11623
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Managing phpbb via CLI

Post by warmweer »

hiran wrote: Tue Apr 02, 2024 10:38 am
What is the recommended way to handle the install folder, if I need it for installation and for upgrades but must not have it during normal operation.
Rename? Set privileges? Delete and restore? Or something entirely else?
For installing and upgrading/updating you need the/install that comes with the phpBB package (you're upgrading/updating to).
With the /install present, access will be limited to the ACP.

In testing situations, I just rename it, on a live board I delete it
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.
hiran
Registered User
Posts: 25
Joined: Sun Mar 03, 2024 10:14 pm

Re: Managing phpbb via CLI

Post by hiran »

warmweer wrote: Tue Apr 02, 2024 10:46 am For installing and upgrading/updating you need the/install that comes with the phpBB package (you're upgrading/updating to).
With the /install present, access will be limited to the ACP.

In testing situations, I just rename it, on a live board I delete it
So actually it is even better to delete the install folder, as it is only required to install.

For upgrades, I download the new distribution but just extract the install folder, so that I can run the upgrade from my existing installation to the desired one. During the upgrade the remainder of the files will be downloaded automatically? At least that's what I understand from the above.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26791
Joined: Fri Aug 29, 2008 9:49 am

Re: Managing phpbb via CLI

Post by Mick »

For a normal update this is the recommended way to carry out updating (not upgrading) one version of phpBB 3.3 to a newer version of 3.3, Minor Updates Within 3.3.x for example. You need file updates as well as database.

Have a look at these instructions, they describe some specific CLI instructions.
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧

Return to “phpBB Discussion”