# ownCloud 9.0 Server Administration Manual

# Upgrade ownCloud From Packages

Note

Starting with ownCloud 8.2 the Linux package repositories have changed, and you must configure your system to use these new repositories to install or upgrade ownCloud 8.2+. The new repositories are at our Open Build Service.

## Upgrade Quickstart

The best method for keeping ownCloud current on Linux servers is by configuring your system to use ownCloud’s Open Build Service repository. Then stay current by using your Linux package manager to install fresh ownCloud packages. After installing upgraded packages you must run a few more steps to complete the upgrade. These are the basic steps to upgrading ownCloud:

- Disable all third-party apps.
- Make a fresh backup.
- Upgrade your ownCloud packages.
- Run occ upgrade (optionally disabling the migration test).
- Apply strong permissions to your ownCloud directories.
- Take your ownCloud server out of maintenance mode.
- Re-enable third-party apps.

## Upgrade Tips

Upgrading ownCloud from our Open Build Service repository is just like any normal Linux upgrade. For example, on Debian or Ubuntu Linux this is the standard system upgrade command:

    apt-get update && apt-get upgrade

Or you can upgrade just ownCloud with this command:

    apt-get update && apt-get install owncloud

On Fedora, CentOS, and Red Hat Linux use `yum` to see all available updates:

    yum check-update

You can apply all available updates with this command:

    yum update

Or update only ownCloud:

    yum update owncloud

Your Linux package manager only downloads the current ownCloud packages. Then your ownCloud server is immediately put into maintenance mode. You may not see this until you refresh your ownCloud page.

Then use `occ` to complete the upgrade. You must run `occ` as your HTTP user. This example is for Debian/Ubuntu:

    sudo -u www-data php occ maintenance:mode --off

This example is for Fedora/CentOS/Red Hat:

    sudo -u apache php occ maintenance:mode --off

## Migration Test

Before completing the upgrade, ownCloud first runs a simulation by copying all database tables to new tables, and then performs the upgrade on them, to ensure that the upgrade will complete correctly. The copied tables are deleted after the upgrade. This takes twice as much time, which on large installations can be many hours, so you can omit this step with the `--skip-migration-test` option, like this example on CentOS:

    $ sudo -u apache php occ upgrade --skip-migration-test

## Setting Strong Directory Permissions

After upgrading, verify that your ownCloud directory permissions are set according to Setting Strong Directory Permissions.

If the upgrade fails, then you must try a manual upgrade.