For a Nextcloud instance which has not been updated in a while, I attempted an update. First I ran sudo dietpi-update which updated a lot of apt-based packages and also dietpi it self (now on version 8.24.1).
It did not update nextcloud, but this is expected as it is not apt-based, correct?
phpenmod phar # The PHP Phar module is required
sudo -u www-data php /var/www/nextcloud/updater/updater.phar
First of all, phpenmod phar result in “phpenmod: command not found” → is it supposed to be sudo phpenmod phar (which returns nothing)?
Anyways, the second line sudo -u www-data php /var/www/nextcloud/updater/updater.phar updated nextcloud from 22.2.0.2 to 22.2.10.2.
And update to newer major version seems not be possible this way. Is this intended? What is the recommended way to update Nextcloud when one or several major release versions are jumped, e.g. 22 → 27 or 28?
Also I looked at this NC guideline for manual upgrades. However, looking at what is described as critical changes, I see for example php ≥8.3 is required (currently php is 7.4). Would I need to update php manually, and if so, before or after NC upgrade? Would I also need to upgrade something else? The web server, or the DB system perhaps? I got both through the dietpi software package 82: LLMP: Lighttpd + MariaDB + PHP
Normally you do system maintenance as root user, so no sudo is needed. But you are right, the phpenmod only returns a message if the module you wanna try to activate does not exist.
And it’s a manual update, not an upgrade. If you wanna manually upgrade to a newer major version, you can follow the Nextcloud docs, but it’s less a hassle with the web updater.
But let’s see what the additional system info will show, maybe you are not able to upgrade to a newer major version causes of some system limitation.
Would be quite a reasonable task to add sudo to all commands in the docs. It does not hurt when you are root already. Also not everyone knows how to use sudo correctly in all cases, e.g. when aiming to write to a file:
IMO is best, as it is not hard aborted when e.g. the network connection between browser and server is lost, or just the tab closed accidentally. The phar module should be enabled OOTB so that phpenmod should not be required (but failsafe).
I didn’t know about this step by step procedure. I only ran the command once and it updated from 22.2.0.2 to 22.2.10.2
So, I will try again and let you know.