Manual ownCloud Upgrade
There are several steps necessary before you can start with upgrading your owncloud instance.
There are two ways to enable maintenance mode.
The preferred method is to use the occ command — which you must run as your webserver user.
# Enable maintenance mode using the occ command. sudo -u www-data php occ maintenance:mode --on
The other way is by changing the value in your
config.phpfile and replacing
'maintenance' ⇒ false,with
'maintenance' ⇒ true,.
|In a clustered environment, check that all nodes are in maintenance mode.|
With those steps completed, stop your webserver.
# Stop the web server sudo service apache2 stop
First, backup ownCloud and the server database as described in section Backing up ownCloud. This is independent of the next upgrade steps but important in case something goes wrong.
Review any installed third-party apps for compatibility with the new ownCloud release. Ensure that they are all disabled before beginning the upgrade. Third party apps are all apps that are not distributed by ownCloud or not listed in Supported Apps in ownCloud.
Disable via Command Line
# This command lists all apps by <app-id> and app version sudo -u www-data php occ app:list # This command disables the app with the given <app-id> sudo -u www-data php occ app:disable <app-id>
Disable via Browser
Go to and disable all third-party apps.
Although you have already made a backup, move your current ownCloud directory to a different location for easy access later:
# This example assumes Ubuntu Linux and MariaDB # Rename ownCloud directory mv /var/www/owncloud /var/www/backup_owncloud
Download the latest ownCloud server release to where your previous installation was, in this example the default directory
cd /var/www/ wget https://download.owncloud.org/community/owncloud-10.7.0.tar.bz2
If you have configured a script for guided installations, you can use it for the upgrade as well. If not, proceed with the manual upgrade.
In this description we assume that your ownCloud installation was located in the default directory:
Extract the new server release in the location where your previous ownCloud installation used to be.
tar -xf owncloud-10.7.0.tar.bz2
With the new source files now in place of where the old ones used to be, copy the
config.php file from your old ownCloud directory to your new ownCloud directory:
cp /var/www/backup_owncloud/config/config.php /var/www/owncloud/config/config.php
If you keep your
data/ directory inside your
owncloud/ directory, move it from your old version of ownCloud to your new version:
mv /var/www/backup_owncloud/data /var/www/owncloud/data
If you keep your
data outside of your
owncloud directory, then you don’t have to do anything with it, because its location is configured in your original
config.php, and none of the upgrade steps touch it.
Before getting too far into the upgrade process, note how the Market app and its configuration options affect the upgrade process. The Market app — and other apps from the Marketplace — will not be updated when you upgrade ownCloud, if
upgrade.automatic-app-update is set to
true in config.php.
In addition, if there are installed apps (whether compatible or incompatible with the next version, or missing source code) and the Market app is enabled but there is no available internet connection, these apps will need to be manually updated once the upgrade is finished.
If you are using third party or enterprise applications, look in your new
/var/www/owncloud/apps/ directory to see if they are present.
If not, copy them from your old
apps/ directory to your new one.
Make sure that all app directories that are defined in the
To finalize the preparation of the upgrade, you need to set the correct ownership of the new ownCloud files and folders.
sudo chown -R www-data:www-data /var/www/owncloud
With the apps disabled and ownCloud in maintenance mode, start the upgrade process from the command line:
# Here is an example on Ubuntu Linux. # Execute this within the ownCloud root folder. sudo -u www-data php occ upgrade
The upgrade operation can take anywhere from a few minutes to a few hours, depending on the size of your installation. When it is finished you will see either a success message or an error message that indicates why the process did not complete successfully.
Assuming your upgrade succeeded, disable maintenance mode.
# Disable maintenance mode using the occ command. sudo -u www-data php occ maintenance:mode --off
With maintenance mode disabled and the web server running, login via the web interface and perform the following steps:
Check that the version number reflects the new installation.
It can be reviewed at the bottom of .
Check that your other settings are correct.
Go to thepage and review the core apps to make sure the right ones are enabled.
After the upgrade is complete, re-enable any third-party apps that are compatible with the new release. Use
occ app:enable <app-id>or go to and enable all compatible third-party apps.
|Install or enable unsupported apps at your own risk.|
If you need to rollback your upgrade, see the Restoring ownCloud documentation.
When upgrading ownCloud and you are running MySQL or MariaDB with binary logging enabled, your upgrade may fail with these errors in your MySQL/MariaDB log:
An unhandled exception has been thrown: exception 'PDOException' with the message 'SQLSTATE[HY000]: General error: 1665 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.'
Please refer to MySQL / MariaDB with Binary Logging Enabled on how to correctly configure your environment.
In the unlikely case that files do not show up in the web-ui after the upgrade, use the files:scan command to make them visible again. Here is an example of how to do so:
sudo -u www-data php occ files:scan --all
See the Docs & Guides page for further resources for both home and enterprise users.
Sometimes, ownCloud can get stuck in an upgrade. This is usually due to the process taking too long and running into a PHP time-out. Stop the upgrade process this way:
sudo -u www-data php occ maintenance:mode --off
Then start the manual process:
sudo -u www-data php occ upgrade
If this does not work properly, try the repair function:
sudo -u www-data php occ maintenance:repair