Ubuntu – New NextCloud installation requires change but I’m not sure where to run this line of code

16.04command lineMySQLnextcloud

I just installed NextCloud 15 on a new installation of Ubuntu 16.04.5 LTS.

The welcome page shows this:

Some columns in the database are missing a conversion to big int. Due
to the fact that changing column types on big tables could take some
time they were not changed automatically. By running 'occ
db:convert-filecache-bigint' those pending changes could be applied
manually. This operation needs to be made while the instance is
offline. For further details read the documentation page about this.
filecache.mtime filecache.storage_mtime

Where do I run this command at and how:

occ db:convert-filecache-bigint

I tried running it on the command line and also the mysql command line. The command line said occ not found and mysql said it was bad syntax.

Where do I execute this line at?

Best Answer

occ is a console script in the Nextcloud html directory, which should be per default located at /var/www/html/nextcloud or maybe /var/www/nextcloud/.

You can cd into that directory and run ./occ from there:

cd /var/www/html/nextcloud
./occ db:convert-filecache-bigint

or run it from anywhere with full path provided:

/var/www/html/nextcloud/occ db:convert-filecache-bigint

Note that the official documentation states that you must run occ as your HTTP user (which defaults to www-data in Debian/Ubuntu) to ensure that the correct permissions are maintained on your Nextcloud files and directories:
sudo -u www-data php occ or sudo -u www-data php /var/www/html/nextcloud/occ

See: > Using the occ command


If you have installed Nextcloud as a snap package, you can run occ as nextcloud.occ.

nextcloud.occ db:convert-filecache-bigint
Related Question