Manually upgrade owncloud from 9.1.6 to 10.0.2

จาก Wiki Opensource

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

Manually upgrade owncloud from 9.1.6 to 10.0.2

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
wget https://download.owncloud.org/community/owncloud-10.0.2.tar.bz2
tar xjf owncloud-10.0.2.tar.bz2 
service apache2 stop
cd ..
mv owncloud owncloud1002
mv tmp/owncloud .
cp owncloud1002/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
REM
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
https://servername.domain

/////Clean unwanted directories and files
rm -rf owncloud1002
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 setting-strong-directory-permissions.sh
#!/bin/bash
ocpath='/var/www/html/owncloud'
htuser='www-data'
htgroup='www-data'
rootuser='root'
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 -R ${htuser}:${htgroup} ${ocpath}/themes/
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
chmod 0644 ${ocpath}/.htaccess
chmod 0644 ${ocpath}/data/.htaccess
# bash setting-strong-directory-permissions.sh


[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
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 0.8.2
Updating <files_texteditor> ...
Updated <files_texteditor> to 2.2
Updating <gallery> ...
Updated <gallery> to 16.0.2
Updating <activity> ...
Updated <activity> to 2.3.4
Updating <dav> ...
Updated <dav> to 0.2.9
Updating <files_external> ...
Updated <files_external> to 0.7.0
Drop old database tables

 Done
 28/28 [================] 100%
Fix permissions so avatars can be stored again
 Done
 2/2 [================] 100%
Move user avatars outside the homes to the new location
 Done
 7/7 [================] 100%
Starting code integrity check...
Finished code integrity check
Update successful
Maintenance mode is kept active
Reset log level
#