Steps on upgrading:
Step 1: Check the current version
rpm -qa | grep owncloud
Step 2: Backup the data and the configuration file and usually located in /var/www/html for any redhat-based distro. And turn it on maintenance mode.
cd /var/www/html/owncloud
cp -Rfp data ../data.old
cp -Rfp config ../config.old
Note: it will be copied to /var/www/html and for debian-based change -u apache to -u www-data.
cd /var/www/html/owncloud sudo -u apache php occ app:list sudo -u apache php occ app:enable <app-id>
Step 4. Turn on the maintenance mode.
sudo -u apache php occ maintenance:mode --off
Step 5: Move existing repository for the ownCloud, in my case using the OpenSuse repo previously.
cd /etc/yum.repos.d/
mv isv:ownCloud:community.repo isv:ownCloud:community.repo.x
Step 6. Update the repository for ownCloud 9.x, in my case using CentOS_6 owncloud-files-9.0.2-2 on the last part from this url (a verbatim copy). As I don't want to update my php.
Run the following shell commands as root to trust the repository.
Run the following shell commands as root to trust the repository.
rpm --import https://download.owncloud.org/download/repositories/stable/CentOS_6/repodata/repomd.xml.key
wget http://download.owncloud.org/download/repositories/stable/CentOS_6/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo
yum clean expire-cache
yum install owncloud-files
Step 7: It now upgraded to latest release, check in cli "sudo -u apache php occ status". In your web browser you will be prompted to start the upgrade, but later on you will encounter an error like:
Exception: Updates between multiple major versions and downgrades are unsupported.Update failed
In the command line:
Step 8: Modify the configuration file and change it to the correct version.sudo -u apache php occ upgrade ownCloud or one of the apps require upgrade - only a limited number of commands are available You may use your browser or the occ upgrade command to do the upgrade Set log level to debug Turned on maintenance mode Exception: Updates between multiple major versions and downgrades are unsupported. Update failed Maintenance mode is kept active Reset log level
sudo -u apache php occ status - installed: true - version: 9.0.2.2 - versionstring: 9.0.2 - edition:
vi config/config.php
#change the version from 8.1.8.2
'version' => '8.1.8.2',
to
# version 9.0.2
'version' => '9.0.2.2',
then save and exit.
Step 9: Do step 7, or use your browser to upgrade and turn off the maintenance mode.
sudo -u apache php occ maintenance:mode --off
Step 10: You have to enable back those disable apps in step 3, it need one at a time - no shortcut. Example (your apps may differ to mine).
Step 11: Viola! you have now updated your owncloud to the latest version. But if you wanted to get rid of the annoying Security & setup warnings.
Security & setup warnings• The "Strict-Transport-Security" HTTP header is not configured to at least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our security tips.• No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.Please double check the installation guides ↗, and check for any errors or warnings in the log.
Do these further steps:
a. Install memcache and check if running.
yum install memcached
ps ax | grep memcached
b. Modify the config.php, to include memcache settings, after any comma (,)
vi config/config.php
'memcache.local' => '\OC\Memcache\APCu', 'memcache.distributed' => '\OC\Memcache\Memcached', 'memcached_servers' => array( array('localhost', 11211), array('mabco.panganod.org', 11211), ),
vi /etc/httpd/conf.d/ssl.conf
#put these line before </VirtualHost>, as seen at the bottom.
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
</IfModule>
</VirtualHost>
#save and exit.
service httpd restart
Note:
I am not responsible for any loss of your data if something gonna wrong for following this guide. Backup is highly recommended prior to do those steps.


