今まで21.0.5を使っていましたが、最新版にしようと。
どうやらNextcloudにはコマンドラインで更新ができるようなので、やってみました。
手順はこう。
# メンテナンスモードに入る sudo -u www-data php occ maintenance:mode --on # 更新を実施 sudo -u www-data php updater/updater.phar
最初にやったらメモリが足りないと言われました。
[ ] Verify integrity ...PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 159323528 bytes) in phar:///var/www/html/updater/updater.phar/lib/Updater.php on line 637
メモリを一時的に増やして再チャレンジです。
vim /usr/local/etc/php/php.ini memory_limit = 512M
先ほど実施した途中経過が残っているようです。
sudo -u www-data php updater/updater.phar (略) Step 5 is currently in process. Please call this command later.
途中経過の状態を削除します。
こちらの記事を参考にさせていただきました。
# xxxxxxxxxxxx には個々の環境で一意な文字列が入る rm -rf ../nextcloud_data/updater-xxxxxxxxxxxx/
再チャレンジです。
3分くらいで終わりました。
time sudo -u www-data php updater/updater.phar Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4 Current version is 21.0.5. Update to Nextcloud 22.2.0 available. (channel: "stable") Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-22.2.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] y # y を入力してEnter Info: Gracefully stopping the updater via Ctrl-C is not possible - PCNTL extension is not loaded. [✔] 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] # 何も押さずにEnter (長いので省略) Keep maintenance mode active? [y/N] # メンテナンスモード終了させるため何も押さずEnter The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see https://www.php.net/manual/en/book.pcntl.php Maintenance mode disabled Maintenance mode is disabled real 3m20.641s user 0m33.321s sys 0m34.449s
バージョンは確かに上がりました。

Preview-Generatorを使っていましたが、無効になりました。
大きな影響はありませんので、このまま使い続けます。

終わりに
いかがでしたか。
最新版にすると動かなくなってしまう可能性もあるので、
バックアップを取ってからの作業をオススメします!
Comments