Manually upgrade owncloud from 9.1.6 to 10.0.3

จาก Wiki Opensource

ปรับปรุงครั้งล่าสุดวันที่ 1-10-2560
เขียนโดย วิบูลย์

Manually upgrade owncloud from 10.0.2 to 10.0.3

sudo su

/////If use cron.php, then stop cron.
vi /etc/cron.d/owncloud-cron-dot-php
#*/15  *  *  *  * www-data php -f /var/www/html/owncloud/cron.php

#Working directory
cd /var/www/html

/////Start upgrade
sudo -u www-data php owncloud/occ maintenance:mode --on

mkdir tmp
cd tmp
tar xjf owncloud-10.0.3.tar.bz2 
service apache2 stop
cd ..
mv owncloud owncloud1003
mv tmp/owncloud .
cp owncloud1003/config/config.php owncloud/config/
cd owncloud
REM Because our owncloud data is soft link to /srv/data so I need to make a soft link
ln -s /srv/data/ data
service apache2 start
cd ..
chown -R www-data:www-data owncloud
sudo -u www-data php owncloud/occ upgrade

/////Finish upgrade
sudo -u www-data php owncloud/occ maintenance:mode --off

/////Testing via web interfaces

/////Clean unwanted directories and files
rm -rf owncloud1003
rm -rf tmp

/////If use cron.php, then start cron.
vi /etc/cron.d/owncloud-cron-dot-php
*/15  *  *  *  * www-data php -f /var/www/html/owncloud/cron.php

[Setting strong directory permissions]
# cd
# mkdir manage_owncloud
# cd manage_owncloud/
# vi
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
chmod 0644 ${ocpath}/.htaccess
chmod 0644 ${ocpath}/data/.htaccess
# bash

[output when upgrading]
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
Updating database schema
Updated database
Starting code integrity check...
Finished code integrity check
Update successful
Maintenance mode is kept active
Reset log level