How to Update ownCloud 10.x to the Latest Version

Ever wanted to update your ownCloud server to stay current with the latest stable release? You’re in the right place to learn how to update ownCloud 10.x to the latest stable version.

I will keep this article brief and focused, avoiding unnecessary details.

The update is incremental, and we will not proceed directly to the latest version available. If you currently have version 10.13.x, we will actively update it to 10.14.x first, and we will apply the same process to 10.15.x and subsequent versions.

Note: I do not recommend updating through the ownCloud user interface.

Download ownCloud

In this article, we will update from version 10.13.x to 10.14.x. To do this, we need to download the next closest available version, which is 10.14.0.

cd /var/www/
mkdir downloads && cd downloads

wget https://download.owncloud.com/server/stable/owncloud-10.14.0.zip

Unzip the downloaded archive:

unzip owncloud-10.14.0.zip

The files and directories will be unzipped to an owncloud directory.

Maintenance mode

We can now place ownCloud in maintenance mode. I assume your ownCloud is installed in the /var/www/html directory; please adjust if it is different.

sudo -u www-data php /var/www/html/occ maintenance:mode --on

Backup

I assume your data directory is located outside the ownCloud installation directory. At this point, we will back up the current ownCloud installed files for safety and also back up the database.

cp -r /var/www/html /var/www/downloads/backup

Run the following command to back up the database, replacing USER and DATABASE as needed and entering the password when prompted. You can find these details in the config.php file located at /var/www/html/config/config.php.

mysqldump -u USER -p DATABASE > /var/www/downloads/db-bak.sql

Update

To begin the update process, we will first move the root directory and then copy the downloaded files to serve as the new web root.

mv /var/www/html /var/www/html_bak

mv /var/www/downloads/owncloud /var/www/html

Now, let’s set the appropriate permissions for it.

chown -R www-data:www-data /var/www/html
chmod -R 755 /var/www/html
find /var/www/html -type d -exec chmod 750 {} \;
find /var/www/html -type f -exec chmod 640 {} \;

After completing that step, we will initiate the update process.

sudo -u www-data php /var/www/html/occ upgrade

If you encounter any issues related to an unsupported app, disable that app and run the update again. For example, use the command for files_external.

sudo -u www-data php /var/www/html/occ app:disable files_external

After upgrade if ownCloud is still in maintenance mode, turn it off.

sudo -u www-data php /var/www/html/occ maintenance:mode --off

Next

We have successfully updated to version 10.14.0. The same process can be applied to update to 10.15.x from here. Follow the steps, and you will reach 10.15.x in no time.