Upgrading NextCloud on PLESK Server

I encountered timeouts and problems with the web updater of NextCloud. Since it is super easy to use the command line updater and nothing like that has appeared here I think this is the way to go. I run a root server with PLESK. I use PHP 7.3 installed via plesk for the cloud subdomain.

Here are all the commands:

Change directory to wherever your NextCloud installation is located:

[code] cd /var/www/vhosts/DOMAIN/cloud [/code]

Your USER would be www-data or the owner of the domain in PLESK:

[code]
sudo -u USER /opt/plesk/php/7.3/bin/php updater/updater.phar
[/code]

Say “yes” to start the upgrade.

Say no here! The system php maybe different from the one used by Plesk.

[code]
sudo -u USER /opt/plesk/php/7.3/bin/php occ upgrade
[/code]

This checks if some maintenance on db side (not indexed columns) needs to be taken care of.

[code]
sudo -u USER /opt/plesk/php/7.3/bin/php ./occ db:add-missing-indices
[/code]

Then switch off the maintenance mode.

[code]
sudo -u USER /opt/plesk/php/7.3/bin/php occ maintenance:mode –off
[/code]