Upgrade Nextcloud z ver. 22 na ver. 23

V lete 2021 som nasadzoval Nextcloud Hub do linuxového kontajnera, ale už som nesledoval ako sa vyvíjajú aktualizácie. Dnes som sa po dlhšom čase prihlási do administrácie Nextcloud a videl som, že tam svieti nejaká aktualizácia. Zistil som, že aktuálna ver. Nextcloud Hub je  22.1.0 a dostupná je ver. 22.2.3. Na aktualizáciu som použil webový updater. Aktualizácia prebehla úspešne. Dnes si ale ukážeme ako spraviť upgrade z ver. 22 na ver. 23.

Verzia Nextcloud 23 (resp. Nextcloud Hub II) uzrela svetlo sveta už koncom Novembra 2021. Aké novinky priniesla táto ver. sa dočítate v blogu na oficiálnom webe nextcloud.com. Upgrade budeme vykonávať v príkazovom riadku. Netreba sa ničoho báť, bude sa jednať len o niekoľko príkazov. Počas upgradu sa nevyskytol žiadny problém, takže som nemusel hľadať iné riešenia.

Poďme na to. Prihlásime sa do linuxového kontajnera cez SSH a môžeme vykonať update a upgrade celého systému.

sudo apt update
sudo apt upgrade

Následne prejdeme do adresára, kde je uložený obsah Nextcloud a skontrolujeme prítomnoť súboru update.phar

cd /var/www/html/www.example.com
cd updater/
ls

Výsledkom by mali byť 2 súbory

index.php  updater.phar

Presunieme sa o adresár vyššie a spustíme príkaz

cd ..
sudo -u www-data php /var/www/html/www.example.com/updater/updater.phar

Výstup príkazu bude podobný tomu

Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4
 
Current version is 22.2.3.
 
Update to Nextcloud 23.0.0 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-23.0.0.zip
Open changelog ↗
 
Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done
 
Start update? [y/N]

Potvrdíme Y a uvidíme

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.
 
[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done
 
 
Update of code successful.
 
Should the "occ upgrade" command be executed? [Y/n]

Vyzerá, že všetko je v poriadku, takže znova potvrdíme Y. Po chvíli dostaneme otázku

Keep maintenance mode active? [y/N]

Teraz môžeme potvrdiť N

sudo -u www-data php /var/www/html/www.example.com/updater/updater.phar --no-interaction

Výstupom bude

Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4
 
Current version is 23.0.0.
 
Update to Nextcloud 23.0.0 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-23.0.0.zip
Open changelog ↗
 
Updater run in non-interactive mode.
 
Continue update
 
Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.
 
[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done
 
Update of code successful.
Updater run in non-interactive mode - will start "occ upgrade" now.

následne sa vykoná upgrade a na konci by sme mali vidieť

Updater run in non-interactive mode - will disable maintenance mode now.
Maintenance mode already disabled
 
Maintenance mode is disabled

Teraz sme aktualizovali na NextCloud Hub 23. Keď prejdeme do webového admin rozhrania Nextcloud a preklikneme sa do

Setting --> Overview

Uvidíme tam 2 upozornenia, že v databáze chýbaju niektoré indexi.

There are some warnings regarding your setup.
The database is missing some indexes. Due to the fact that adding indexes on big tables could take some time they were not added automatically. By running "occ db:add-missing-indices" those missing indexes could be added manually while the instance keeps running. Once the indexes are added queries to those tables are usually much faster.
Missing index "fs_id_storage_size" in table "oc_filecache".
Missing index "fs_storage_path_prefix" in table "oc_filecache".

Na to nám stačí použiť, príkaz, ktorý to vyrieši. Presunieme sa do terminálu a ak sme nevystúpili z pracovného adresára, tak použijeme príkaz

sudo -u www-data php occ db:add-missing-indices

Výsledkom by mohlo byť toto

Check indices of the share table.
Check indices of the filecache table.
Adding additional size index to the filecache table, this can take some time...
Filecache table updated successfully.
Adding additional path index to the filecache table, this can take some time...
Filecache table updated successfully.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.

O tom, že je všetko v poriadku sa môžeme presvedči v prehľade webovej administrácie nextcloud. Tak isto si mžeme prekontrolovať bezpečnosť Nextcloud servera. Výsledok by mal byť A+

Leave a Reply

Vaša e-mailová adresa nebude zverejnená. Vyžadované polia sú označené *