Ein direktes Update von Owncloud 8.2 auf 9.1 ist so leider nicht möglich, da man zuerst über die Zwischenversion 9.0 gehen muss.
Im Folgenden wird davon ausgegangen, dass OC direkt im Root Verzeichnis des Apache liegt. Sollte das anders sein, müssen die Pfade dementsprechend angepasst werden. Außerdem ist das Datenverzeichnis auf eine eigene Partition ausgelagert.
Update Owncloud 8.2 auf 9.0
Als erstes wechselt man in das OC Root Verzeichnis, um den Wartungsmodus einzuschalten. Das occ Skript muss dabei im Kontext des Besitzers ausgeführt werden (www-data als Apache Benutzer)
su - www-data -s /bin/bash -c 'php occ maintenance:mode --on'
Anschließend kann die neue OC Version heruntergeladen und entpackt werden.
wget https://download.owncloud.org/community/owncloud-9.0.4.zip
unzip owncloud-9.0.4.zip
Danach wird das ursprüngliche Installationsverzeichnis verschoben und das neue Verzeichnis anstelle des Alten benutzt:
mv www www-orig
mv owncloud www
Nun muss die config.php und das Datenverzeichnis (data) aus der alten Installation in das neue Verzeichnis kopiert werden. Sollte das Datenverzeichnis außerhalb des Owncloud Verzeichnisses liegen, so muss nur die Konfiguration kopiert werden:
cp www-orig/config/config.php www/config/config.php
Anpassen der Rechte:
chown www-data:www-data www -R
Ausführen des eigentlichen Upgradeprozesses:
su - www-data -s /bin/bash -c 'php occ upgrade'
Nun kann auf Version 9.1 migriert werden.
Upgradebefehle Copy & Paste:
cd /var/www
su - www-data -s /bin/bash -c 'php occ maintenance:mode --on'
cd ..
wget https://download.owncloud.org/community/owncloud-9.0.4.zip
unzip owncloud-9.0.4.zip
mv www www-orig
mv owncloud www
cp www-orig/config/config.php www/config/config.php
chown www-data:www-data www -R
cd www
su - www-data -s /bin/bash -c 'php occ upgrade'
Update Owncloud 9.0 auf 9.1
Das Upgrade verhält sich analog zum oben beschriebenen Upgradeprozess.
cd /var/www
su - www-data -s /bin/bash -c 'php occ maintenance:mode --on'
cd ..
wget https://download.owncloud.org/community/owncloud-9.1.0.zip
unzip owncloud-9.1.0.zip
mv www www-90
mv owncloud www
cp www-90/config/config.php www/config/config.php
chown www-data:www-data www -R
cd www
su - www-data -s /bin/bash -c 'php occ upgrade'
su - www-data -s /bin/bash -c 'php occ maintenance:mode --off'
Sollte dann in etwa so aussehen:
su - www-data -s /bin/bash -c '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 Checking whether the database schema can be updated (this can take a long time depending on the database size) Done 24/24 [============================] 100% Checked database schema update Checking updates of apps Checking whether the database schema for <activity> can be updated (this can take a long time depending on the database size) Done 2/2 [============================] 100% Checking whether the database schema for <dav> can be updated (this can take a long time depending on the database size) Done 10/10 [============================] 100% Checking whether the database schema for <federatedfilesharing> can be updated (this can take a long time depending on the database size) Done 1/1 [============================] 100% Checking whether the database schema for <federation> can be updated (this can take a long time depending on the database size) Done 1/1 [============================] 100% Checking whether the database schema for <files_sharing> can be updated (this can take a long time depending on the database size) Done 1/1 [============================] 100% Checking whether the database schema for <files_trashbin> can be updated (this can take a long time depending on the database size) Done 1/1 [============================] 100% Checking whether the database schema for <notifications> can be updated (this can take a long time depending on the database size) Done 1/1 [============================] 100% Checked database schema update for apps Updating database schema Updated database Updating <federatedfilesharing> ... Updated <federatedfilesharing> to 0.3.0 Updating <provisioning_api> ... Updated <provisioning_api> to 0.5.0 Updating <updatenotification> ... Updated <updatenotification> to 0.2.1 Updating <federation> ... Updated <federation> to 0.1.0 Updating <files> ... Updated <files> to 1.5.1 Updating <activity> ... Updated <activity> to 2.3.2 Updating <dav> ... Fix classification for calendar objects Done 18/18 [============================] 100% Updated <dav> to 0.2.5 Updating <files_sharing> ... Updated <files_sharing> to 0.10.0 Updating <files_trashbin> ... Updated <files_trashbin> to 0.9.0 Updating <files_versions> ... Updated <files_versions> to 1.3.0 Updating <comments> ... Updated <comments> to 0.3.0 Updating <notifications> ... Updated <notifications> to 0.3.0 Updating <systemtags> ... Updated <systemtags> to 0.3.0 Drop old database tables Done 28/28 [============================] 100% Remove old (< 9.0) calendar/contact shares Done 4/4 [============================] 100% Fix permissions so avatars can be stored again Done 2/2 [============================] 100% Starting code integrity check... Finished code integrity check Update successful Maintenance mode is kept active Reset log level
su - www-data -s /bin/bash -c 'php occ maintenance:mode --off'
ownCloud is in maintenance mode - no app have been loaded Maintenance mode disabled
Abschließend sollten die Berechtigungen auf die Dateien ordnungsgemäß gesetzt werden.
Strong Directory Permissions
Datei erstellen nano /tmp/perms.sh
und befüllen:
#!/bin/bash ocpath='/var/www' htuser='www-data' htgroup='www-data' rootuser='root' printf "Creating possible missing Directoriesn" mkdir -p $ocpath/data mkdir -p $ocpath/assets mkdir -p $ocpath/updater printf "chmod Files and Directoriesn" find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 printf "chown Directoriesn" chown -R ${rootuser}:${htgroup} ${ocpath}/ chown -R ${htuser}:${htgroup} ${ocpath}/apps/ chown -R ${htuser}:${htgroup} ${ocpath}/assets/ chown -R ${htuser}:${htgroup} ${ocpath}/config/ chown -R ${htuser}:${htgroup} ${ocpath}/data/ chown -R ${htuser}:${htgroup} ${ocpath}/themes/ chown -R ${htuser}:${htgroup} ${ocpath}/updater/ chmod +x ${ocpath}/occ printf "chmod/chown .htaccessn" if [ -f ${ocpath}/.htaccess ] then chmod 0644 ${ocpath}/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/.htaccess fi if [ -f ${ocpath}/data/.htaccess ] then chmod 0644 ${ocpath}/data/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess fi
Ausführbar machen und laufen lassen.
chmod +x perms.sh
./perms.sh
Creating possible missing Directories chmod Files and Directories chown Directories chmod/chown .htaccess
Sollten eigene Themes benutzt werden, müssen die auch noch von der alten Installation in die neue kopiert werden.