Recently I upgraded not just ownCloud, but the server it was on (Ubuntu Server 12.04 to 16.04). To say there were a few changes would be an understatement and, unfortunately there are a few things missing from the official documents.
Before you begin, back-up the data base and the data. Me, I use MariaDB so I just dump that and grab a copy of
/var/www/owncloud. I also have copies of my Apache configurations. For the database I user:
mysqldump --lock-tables -u <USERNAME> -p <PASSWORD> -P<PORT> owncloud > owncloud-sqlbkp_`date +"%Y%m%d"`.bak
Let the server and ownCloud upgrades run.You never know, it might just work for you. For me ownCloud was simply broken. The site would not run and I could not execute
occ as it couldn’t find the database, my PHP modules were all to hell as well. The fix is simple. Scary but simple.
Uninstall ownCloud. Not purge, just uninstall. This will leave the residual configuration which is exactly what you want.
Now install ownCloud again, making sure to select
owncloud-deps-php7.0 when you do so. The reason for that is Ubuntu Server 16.04 installs PHP 7.0 by default and if you have the older
owncloud-deps-php5 package installed, your ownCloud install will not work without a lot of effort.
Once all that is done, jump into you folder and run the
sudo -u <WWW User> php occ upgrade
Bar having to re-enable the Contacts and Calenar apps after logging in are you ownCloud admin user, you should be all done.