Update Nextcloud

If you’re updating Nextcloud, it offers the alternative to run the upgrade via the command line:

However, on most systems you’ll have to work a little harder than just

./occ upgrade

On my system there are 2 main problems:

  • You don’t generally login as the same user as the Nextcloud web service – as I’m using a Debian system the correct user is www-data.
  • It needs to start PHP to run the command, which by default doesn’t include the APCu module when you start it from the command line, so we need to fix that.

This is the command I use:

sudo -u www-data php --define apc.enable_cli=1 ./occ upgrade

And a few of the other commonly-used commands after updating (the Administration Overview screen will tell you which of these you need to run:

sudo -u www-data php --define apc.enable_cli=1 ./occ maintenance:repair --include-expensive
sudo -u www-data php --define apc.enable_cli=1 ./occ db:add-missing-indices

Leave a Reply

Your email address will not be published. Required fields are marked *