Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Manage better updates #3

Closed
pierreozoux opened this issue Nov 22, 2015 · 8 comments
Closed

Manage better updates #3

pierreozoux opened this issue Nov 22, 2015 · 8 comments

Comments

@pierreozoux
Copy link
Member

Let's find a way to understand the good version of each apps, and update them programatically.

Update process:

  1. list all installed and activated apps
  2. update owncloud
  3. check if the list is equal
  4. if list not equal attempt to update all apps and reactivate them
@pierreozoux
Copy link
Member Author

A nice one liner like we love ;)

apt-get update && apt-get install -y sudo 

sudo -u www-data php occ app:list > /tmp/list_before
sudo -u www-data php occ upgrade --no-app-disable
sudo -u www-data php occ app:list > /tmp/list_after

diff <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_before) <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_after) | grep '<' | cut -d- -f2 | cut -d: -f1 | xargs -L 1 sudo -u www-data php occ app:enable

@pierreozoux
Copy link
Member Author

Notes used for update:

docker exec -it --user www-data `echo ${domain}_app_1 |sed 's/-//g' | sed 's/\.//g'` bash

php occ app:list > /tmp/list_before
php occ upgrade --no-app-disable
php occ app:list > /tmp/list_after

diff <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_before) <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_after) | grep '<' | cut -d- -f2 | cut -d: -f1


diff <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_before) <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_after) | grep '<' | cut -d- -f2 | cut -d: -f1 | xargs -L 1 php occ app:enable


cd data/apps
rm -rf contacts
curl -sL https://github.com/owncloud/contacts/releases/download/v0.5.0.0/contacts.tar.gz -O
tar xvzf contacts.tar.gz
rm contacts.tar.gz
chown -R www-data:www-data ./contacts
cd ..
php occ app:enable contacts
php occ upgrade --no-app-disable

rm -rf calendar
curl -sOL https://github.com/owncloud/calendar/releases/download/v0.8.2/calendar.zip
unzip calendar
rm calendar.zip
chown -R 33:33 ./calendar

@pierreozoux
Copy link
Member Author

Notes from upgrade to version 9:


cd data/apps

rm -rf contacts
curl -sL https://github.com/owncloud/contacts/releases/download/v1.0.0.0/contacts.tar.gz -O
tar xvzf contacts.tar.gz
rm contacts.tar.gz
chown -R 33:33 ./contacts


rm -rf calendar
curl -sOL https://github.com/owncloud/calendar/releases/download/v1.0/calendar.tar.gz
tar xvzf calendar.tar.gz
rm calendar.tar.gz
chown -R 33:33 ./calendar



rm -rf documents
curl -sOL https://github.com/owncloud/documents/releases/download/v0.12.0/documents.zip
unzip documents
rm documents.zip
chown -R 33:33 ./documents

cd ..




for app in `ls /usr/src/owncloud/apps/`; do rm -rf ./apps/$app;cp -TR /usr/src/owncloud/apps/$app/ ./apps/$app/; chown -R www-data:www-data ./apps/$app/; done

@pierreozoux
Copy link
Member Author

pierreozoux commented Jun 2, 2016

Notes from upgrade to version 9.0.2:

cd data/apps

rm -rf contacts
curl -sL https://github.com/owncloud/contacts/releases/download/v1.3.1.0/contacts.tar.gz -O
tar xvzf contacts.tar.gz
rm contacts.tar.gz
chown -R 33:33 ./contacts

rm -rf calendar
curl -sOL https://github.com/owncloud/calendar/releases/download/v1.2.2/calendar.tar.gz
tar xvzf calendar.tar.gz
rm calendar.tar.gz
chown -R 33:33 ./calendar

rm -rf mail
curl -sOL https://github.com/owncloud/mail/releases/download/v0.5.1/mail.tar.gz
tar xvzf mail.tar.gz
rm mail.tar.gz
chown -R 33:33 ./mail

rm -rf documents
curl -sOL https://github.com/owncloud/documents/archive/v8.0.13.tar.gz
tar xvzf v8.0.13.tar.gz
mv documents-8.0.13 documents
rm v8.0.13.tar.gz
chown -R 33:33 ./documents

rm -rf registration
curl -sOL https://github.com/pellaeon/registration/archive/v0.1.3.tar.gz
tar xvzf v0.1.3.tar.gz
mv registration-0.1.3 registration
rm v0.1.3.tar.gz
chown -R 33:33 ./registration

cd ../..

docker exec -it --user www-data `echo ${domain}_app_1 |sed 's/-//g' | sed 's/\.//g'` bash

for app in `ls /usr/src/owncloud/apps/`; do rm -rf ./apps/$app;cp -TR /usr/src/owncloud/apps/$app/ ./apps/$app/; chown -R www-data:www-data ./apps/$app/; done

php occ app:list > /tmp/list_before
php occ upgrade --no-app-disable
php occ app:list > /tmp/list_after

diff <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_before) <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_after) | grep '<' | cut -d- -f2 | cut -d: -f1

diff <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_before) <(sed -n "/Enabled:/,/Disabled:/p" /tmp/list_after) | grep '<' | cut -d- -f2 | cut -d: -f1 | xargs -L 1 php occ app:enable

@pierreozoux
Copy link
Member Author

pierreozoux commented Aug 6, 2016

Notes to upgrade to Nextcloud:

docker-compose exec --user www-data app bash

php occ app:list > /tmp/list_before
for app in `ls /usr/src/nextcloud/apps/`; do rm -rf ./apps/$app;cp -TR /usr/src/nextcloud/apps/$app/ ./apps/$app/; chown -R www-data:www-data ./apps/$app/; done
php occ upgrade --no-app-disable
php occ app:list > /tmp/list_after

@pierreozoux
Copy link
Member Author

Notes to upgrade nextcloud from 9.0.53 to 10.0:

for app in `ls /usr/src/nextcloud/apps/`; do rm -rf ./apps/$app;cp -TR /usr/src/nextcloud/apps/$app/ ./apps/$app/; chown -R www-data:www-data ./apps/$app/; done
./occ upgrade

@kujiy
Copy link

kujiy commented Jul 13, 2017

Upgrade procedure 9.1.2 -> 10.0.2

docker-compose pull
docker exec owncloud mv /var/www/html/version.php /var/www/html/version.php.old
docker-compose up -d --force-recreate && docker-compose logs -f
# Tap upgrade button from your browser
# Finished upgrading if you're lucky

One of my ownclouds was succeeded with this procedure but another one faild with CardDavBackend error.

I restored it and gave up at upgrading 9.1.2 -> 9.1.6.

Restore procedure

# restore DB
docker cp backup/owncloud-dbbackup_20170713.bak   owncloud-db:/
docker exec owncloud-db mysql -uroot -p owncloud < /owncloud-dbbackup_20170713.bak 

# restore web source
docker exec -it owncloud /bin/bash
curl https://download.owncloud.org/community/owncloud-9.1.6.tar.bz2 -o owncloud-9.1.6.tar.bz2
bzip2 -dk owncloud-9.1.6.tar.bz2
tar xvf owncloud-9.1.6.tar

## overwrite sources
cp -arp owncloud/* /var/www/html/
chown www-data:www-data apps/ -R

# restore config.php
cp backup/config.php /var/www/html/config/

# Tap upgrade button from your browser

@unteem
Copy link

unteem commented Feb 20, 2019

not maintained anymore moved to nextcloud

@unteem unteem closed this as completed Feb 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants