Put your server in maintenance mode. This prevents new logins, locks the
sessions of logged-in users, and displays a status screen so users know what is
happening. There are two ways to do this, and the preferred method is to use the
occ command, which you must run as
your HTTP user. This example is for Ubuntu Linux:

sudo-uwww-dataphpoccmaintenance:mode--on

The other way is by entering your config.php file and changing
'maintenance'=>false, to 'maintenance'=>true,.

Download and unpack the latest ownCloud Server release (Archive file) from
owncloud.org/install/ into an empty directory outside
of your current installation. For example, if your current ownCloud is
installed in /var/www/owncloud/ you could create a new directory called
/var/www/owncloud2/

Rename or move your current ownCloud directory (named owncloud/ if
installed using defaults) to another location.

This creates a new owncloud/ directory populated with your new server
files. Copy this directory and its contents to the original location of your
old server, for example /var/www/, so that once again you have
/var/www/owncloud .

Copy and paste the config.php file from your old version of
ownCloud to your new ownCloud version.

If you keep your data/ directory in your owncloud/ directory, copy
it from your old version of ownCloud to the owncloud/ directory of
your new ownCloud version. If you keep it outside of owncloud/ 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.

If you are using 3rd party applications, look in your new owncloud/apps/
directory to see if they are there. If not, copy them from your old apps/
directory to your new one. Make sure the directory permissions of your third
party application directories are the same as for the other ones.

Restart your Web server.

Now launch the upgrade from the command line using occ, like this
example on CentOS Linux:

sudo-uapachephpoccupgrade

The upgrade operation takes a few minutes to a few hours, depending on the
size of your installation. When it is finished you will see a success
message, or an error message that will tell where it went wrong.

Assuming your upgrade succeeded, disable the maintenance mode:

sudo-uwww-dataphpoccmaintenance:mode--off

Login and take a look at the bottom of your Admin page to
verify the version number. Check your other settings to make sure they’re
correct. Go to the Apps page and review the core apps to make sure the right
ones are enabled. Re-enable your third-party apps. Then apply strong
permissions to your ownCloud directories (Setting Strong Directory Permissions).