Updating ownCloud manually

ownCloud Is a free and open source web application for data synchronization, file sharing.

Switch to the root user. All further actions will be performed from this user

$ sudo - su

Back up the directory where ownCloud is installed

# rsync -avpP /var/www/owncloud /opt/backups/

Backing up the database

# mysqldump -u root -p owncloud > /opt/backups/owncloud-`date +%F`.sql
Enter password:

Turn on maintenance mode using the occ utility (located in the directory where ownCloud is installed)

# cd /var/www/owncloud
# sudo -u www-data php occ maintenance:mode --on

Stop the webserver

# systemctl stop apache2

Download the ownCloud release to the / tmp directory (At the time of this writing, the final stable version of owncloud is 10.4.1)

# wget https://download.owncloud.org/community/owncloud-10.4.1.tar.bz2 -P /tmp/

Preparing for the update: rename the directory with installed owncloud, unpack the downloaded archive

# cd
# mv /var/www/owncloud /var/www/owncloud-bak
# tar xjf /tmp/owncloud-10.4.1.tar.bz2 -C /var/www/

Assign rights (the webserver runs from the www-data user)

# chown -R www-data:www-data /var/www/owncloud

Copy the directory with data from the old ownCloud (the configuration file specifies the location of the data, maybe you have it on a separate disk, then you can skip this item)

# rsync -avpP /var/www/owncloud-bak/data /var/www/owncloud/

Replace the default config with a working one (from the previous version of ownCloud)

# rsync -avpP /var/www/owncloud-bak/config /var/www/owncloud/

In my config, the apps-external directory was specified, when unpacking the archive it was not there, create this directory

# mkdir /var/www/owncloud/apps-external
# chown www-data:www-data /var/www/owncloud/apps-external

Updating ownCloud

# cd /var/www/owncloud
# sudo -u www-data php /var/www/owncloud/occ upgrade

!!! An error occurred during the update:

Repair warning: You have incompatible or missing apps enabled that could not be found or updated via the marketplace.Repair warning: Please install or update the following apps manually or disable them with: occ app: disable files_videoplayer … OC RepairException: Upgrade is not possibleUpdate failed

The system swears at files_videoplayer, disable it

# sudo -u www-data php /var/www/owncloud/occ app:disable files_videoplayer

Updating

# sudo -u www-data php /var/www/owncloud/occ upgrade

Checking the installed version of ownCloud

# sudo -u www-data php /var/www/owncloud/occ -V

Turn off service mode

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

Restart the webserver

# systemctl restart apache2
Sidebar