Changes
Page history
replace /data/faircloud/nextcloud
authored
Jun 20, 2024
by
Roland Alton
Hide whitespace changes
Inline
Side-by-side
Upgrade-procedure.md
View page @
b5de7fa4
### faircloud upgrade procedure
This is a documentation for fairkom sysadmins. We have to upgrade nextcloud every few months. We share our experience and steps here.
1.
read changelog (to prevent surprises like a global adressbook https://git.fairkom.net/hosting/nextcloud/-/issues/181#note_77248)
1.
announce maintenance with Announcement app (uncheck at three dots to be sent with e-mail to all users, only 20 mails per minute)
1.
in /var/www/nextcloud/config/config.php set
`'maintenance' => true,`
1.
do a manual DB backup and copy to /mnt/backup2/faircloud_db (= external backup drive)
1.
set 'maintenance' => false or set to maintenance page in
`/etc/apache2/sites-enabled/nextcloud.conf`
1.
you always can login at
`https://faircloud.eu/nextcloud2`
(backdoor, not reachable for sync clients)
1.
as nextcloud admin we now run upgrade to the latest minor version in the web interface
1.
~~
`Continue with web based updater`
should be fine with minor updates~~ DEC22: we prefer to upgrade with phar script:
1.
`sudo -u faircloud /usr/bin/php /var/www/nextcloud/updater/updater.phar`
1.
this usually also updates all apps, and there is no way to get back in app versions
1.
check if all apps are working
1.
~~continue with upgrading to next nextcloud major version with
`sudo -u faircloud php occ upgrade`
~~
1.
some repair jobs may take quite long https://git.fairkom.net/hosting/nextcloud/-/issues/111#note_40870
1.
check admin settings overview page
1.
likely you need to do in
`/var/www/nextcloud/`
a
`sudo -u faircloud php ./occ db:add-missing-indices`
1.
check if all apps are working
1.
use the maintenance window for an OS update and reboot if you got a new kernel
2.
remove the Announcement in the Announcement app (so those who did not read it yet won't get it anymore)
In case we need to continue completely manually, we also can change the Alias to maintenance in
`/etc/apache2/sites-available/nextcloud.conf`
### Problemlösung falls das Backup des Installers scheitert
Ist passiert am 22.06.2020 beim Versuch 16.x upzudaten. Das Backup hängt.
*
Zip Datei der genauen Version holen
*
Zip Datei woanders auspacken (/tmp) umbenennen in nextcloud_new, chown -R
*
Mv von nextcloud_new direkt neben /var/www/nextcloud
*
mit diff herausfinden, welche zusätzlichen Apps kopiert werden müssen
*
*
`diff nextcloud/apps/ nextcloud_new/apps/|grep 'Only in nextcloud/apps/' | cut -d ' ' -f 4 > missing-apps`
*
diese Apps kopieren
*
*
`cat missing-apps | while read line; do cp -a nextcloud/apps/$line nextcloud_new/apps/;done`
*
Config Ordner kopieren
*
Datenbankdump ziehen
*
`mv nextcloud nextcloud_bak && mv nextcloud_new/ nextcloud`
*
`sudo -u faircloud php ./occ upgrade`
*
`sudo -u faircloud php ./occ maintenance:repair`
(war in diesem Fall mal wieder nötig)
In diesem Fall war außerdem nötig:
`sudo -u faircloud php ./occ db:convert-filecache-bigint`
Etwas Off-Topic hier, aber ganz wichtig in config.php:
```
/**
* The allowed maximum memory in KiB to be used by the algorithm for computing a
* hash. The smallest possible value is 8. Values that undershoot the minimum
* will be ignored in favor of the default.
*/
'hashingMemoryCost' => 65536,
/**
* The allowed maximum time in seconds that can be used by the algorithm for
* computing a hash. The value must be an integer, and the minimum value is 1.
* Values that undershoot the minimum will be ignored in favor of the default.
*/
'hashingTimeCost' => 4,
```
Als Erinnerung: https://github.com/nextcloud/server/issues/17241
```
'hashingMemoryCost' => 2048,
'hashingTimeCost' => 2,
```
**Problemlösung falls das Backup (oder ein anderer Zwischenschritt) hängt:**
`rm /mnt/storagebox/faircloud_sshfs/updater-52619b9bb6dfb/.step`
**occ command line tool**
```
sudo -u faircloud php ./occ list```
**Alle Apps updaten**
```
sudo -u faircloud php ./occ app:update --all
```
**Apps enablen**
```
sudo -u faircloud php occ app:enable forms
```
Viele auf einmal enablen:
```
cat ../missing-apps | while read line; do sudo -u www-data php occ app:enable $line;sleep 1;done;
```
**Das neue default notes readme Dings kann man abdrehen**
Siehe auch https://help.nextcloud.com/t/i-want-to-hide-the-add-notes-field-at-the-top-of-the-file-list-on-nc18/68574
```
occ config:app:set text workspace_available --value=0
```
**Tipp:** Etwas Tipparbeit bei occ Befehlen kann man sich ersparen mit einem Skript wie diesem in /usr/local/bin:
```
bash
#!/bin/bash
# Shortcut for convenience.
sudo -u faircloud /usr/bin/php /var/www/nextcloud/occ $@
```
### faircloud upgrade procedure
This is a documentation for fairkom sysadmins. We have to upgrade nextcloud every few months. We share our experience and steps here.
1.
read changelog (to prevent surprises like a global adressbook https://git.fairkom.net/hosting/nextcloud/-/issues/181#note_77248)
1.
announce maintenance with Announcement app (uncheck at three dots to be sent with e-mail to all users, only 20 mails per minute)
1.
in /var/www/nextcloud/config/config.php set
`'maintenance' => true,`
1.
do a manual DB backup and copy to /mnt/backup2/faircloud_db (= external backup drive)
1.
set 'maintenance' => false or set to maintenance page in
`/etc/apache2/sites-enabled/nextcloud.conf`
1.
you always can login at
`https://faircloud.eu/nextcloud2`
(backdoor, not reachable for sync clients)
1.
as nextcloud admin we now run upgrade to the latest minor version in the web interface
1.
~~
`Continue with web based updater`
should be fine with minor updates~~ DEC22: we prefer to upgrade with phar script:
1.
`sudo -u faircloud /usr/bin/php /var/www/nextcloud/updater/updater.phar`
1.
this usually also updates all apps, and there is no way to get back in app versions
1.
check if all apps are working
1.
~~continue with upgrading to next nextcloud major version with
`sudo -u faircloud php occ upgrade`
~~
1.
some repair jobs may take quite long https://git.fairkom.net/hosting/nextcloud/-/issues/111#note_40870
1.
check admin settings overview page
1.
likely you need to do in
`/var/www/nextcloud/`
a
`sudo -u faircloud php ./occ db:add-missing-indices`
1.
check if all apps are working
1.
use the maintenance window for an OS update and reboot if you got a new kernel
2.
remove the Announcement in the Announcement app (so those who did not read it yet won't get it anymore)
In case we need to continue completely manually, we also can change the Alias to maintenance in
`/etc/apache2/sites-available/nextcloud.conf`
### Problemlösung falls das Backup des Installers scheitert
Ist passiert am 22.06.2020 beim Versuch 16.x upzudaten. Das Backup hängt.
*
Zip Datei der genauen Version holen
*
Zip Datei woanders auspacken (/tmp) umbenennen in nextcloud_new, chown -R
*
Mv von nextcloud_new direkt neben /var/www/nextcloud
*
mit diff herausfinden, welche zusätzlichen Apps kopiert werden müssen
*
*
`diff nextcloud/apps/ nextcloud_new/apps/|grep 'Only in nextcloud/apps/' | cut -d ' ' -f 4 > missing-apps`
*
diese Apps kopieren
*
*
`cat missing-apps | while read line; do cp -a nextcloud/apps/$line nextcloud_new/apps/;done`
*
Config Ordner kopieren
*
Datenbankdump ziehen
*
`mv nextcloud nextcloud_bak && mv nextcloud_new/ nextcloud`
*
`sudo -u faircloud php ./occ upgrade`
*
`sudo -u faircloud php ./occ maintenance:repair`
(war in diesem Fall mal wieder nötig)
In diesem Fall war außerdem nötig:
`sudo -u faircloud php ./occ db:convert-filecache-bigint`
Etwas Off-Topic hier, aber ganz wichtig in config.php:
```
/**
* The allowed maximum memory in KiB to be used by the algorithm for computing a
* hash. The smallest possible value is 8. Values that undershoot the minimum
* will be ignored in favor of the default.
*/
'hashingMemoryCost' => 65536,
/**
* The allowed maximum time in seconds that can be used by the algorithm for
* computing a hash. The value must be an integer, and the minimum value is 1.
* Values that undershoot the minimum will be ignored in favor of the default.
*/
'hashingTimeCost' => 4,
```
Als Erinnerung: https://github.com/nextcloud/server/issues/17241
```
'hashingMemoryCost' => 2048,
'hashingTimeCost' => 2,
```
**Problemlösung falls das Backup (oder ein anderer Zwischenschritt) hängt:**
`rm /data/faircloud/nextcloud/updater-52619b9bb6dfb/.step`
**occ command line tool**
```
sudo -u faircloud php ./occ list```
**Alle Apps updaten**
```
sudo -u faircloud php ./occ app:update --all
```
**Apps enablen**
```
sudo -u faircloud php occ app:enable forms
```
Viele auf einmal enablen:
```
cat ../missing-apps | while read line; do sudo -u www-data php occ app:enable $line;sleep 1;done;
```
**Das neue default notes readme Dings kann man abdrehen**
Siehe auch https://help.nextcloud.com/t/i-want-to-hide-the-add-notes-field-at-the-top-of-the-file-list-on-nc18/68574
```
occ config:app:set text workspace_available --value=0
```
**Tipp:** Etwas Tipparbeit bei occ Befehlen kann man sich ersparen mit einem Skript wie diesem in /usr/local/bin:
```
bash
#!/bin/bash
# Shortcut for convenience.
sudo -u faircloud /usr/bin/php /var/www/nextcloud/occ $@
```