In my opinion the best way to update NextCloud is using the command line, with the web installer I had some problems, especially if the internet connection is not really fast. Therefore I always use the command line to update NextCloud.
In this blog entry I will give a short tutorial how to update NextCloud to the latest version, using the command line of the jail. For this tutorial I will use the Shell of the TrueNAS web interface.
As first step I would suggest that you update your jail to the latest version. This is quite simple, you can directly do this in the web interface of TrueNAS. Login, go to “Jails” -> select the NextCloud jail -> Press the “>” icon in the right and select “Update”. A dialog will open where you need to confirm, and then the update is executed.
After this, select the shell of the jail.
To remember the default NextCloud jail of TrueNas is using the following installation/configuration settings/paths:
- Webserver: NGINX
- PHP: php-fpm
- Path to NextCloud: /usr/local/www/nextcloud
- User who is running nginx and PHP: www
With this information we will simply call the command line updater of NextCloud using the following command:
sudo -u www php /usr/local/www/nextcloud/updater/updater.phar
If the command is working and no error is thrown you should get the following output (I already pressed Y that I want to update NextCloud):
If you have a problem with the information that stopping the update using Ctrl-C is not possible, you can install the PCNTL extension using snap.
The Updater is now creating a backup, then its downloading the latest NextCloud release, after that it checks the integrity and certain other things. Dependent on the internet connection and the performance of your TrueNAS instance this can take a while.
When the update is successfully the systems asks the user if the
occ upgrade command should be executed. This is necessary to finish the update. During this step changes in the database and the file data structure of NextCloud are executed and new versions of the plugins are installed.
Press “Y” to execute the
occ upgrade. After a while everything should be finished and NextCloud asks you if the maintenance mode should stay active. Enter “N” and NextCloud should again be online.
The update is only executed from the running version to the next one and not to the latest! If there are several versions in between it can be necessary to execute the update command more than one time.