Nextcloud 手動アップデート
概要
一部の環境では、Web モードで built-in Updater を使用することは信頼性が低く (Web サーバーのタイムアウトなどによる)、コマンドラインモードで実行することはオプションではありません (一部の共有ホスティング環境など)。 このような場合は、手動アップグレードが最良の方法かもしれません。
手動アップグレードは、NextcloudアーカイブファイルをPCまたはホストにダウンロードして解凍します。 次に、ホスト上の ``data/`` と ``config/`` を除く、既存の Nextcloud Server インストールファイルとフォルダを削除します。 次に、新しいNextcloudサーバーのインストールファイルをホストのしかるべき場所に移動します、 また、既存のdata/ファイルとconfig/ファイルを保持します。 さらに、インストールされているアプリが新しいインストールに移行されていることを確認し、アクセス許可を調整するなど、いくつかの家事を行う。 たくさんあるように感じるかもしれないが、詳しい説明は以下に示す。
- 重要
- アップグレード、特にメジャーバージョン間(例:v27.y.z -> v28.y.z)のアップグレードを行う前に、まず重要な変更点を確認してください。
- これらは、Nextcloud Serverの変更に対応するためにお使いの環境で必要となる可能性のある変更の要点です。
- これらの注意事項は必要に応じて定期的に改訂されるため、万が一に備えて、マイナーアップグレードやメンテナンスアップグレードを進める際にも再確認することをお勧めします。
- 注意
- 手動でアップグレードする場合は、システムが新バージョンのシステム要件を満たし ていることと、標準的なアップグレード要件(新しいメジャーリリースにアップグレードす る前に最新のメンテナンスリリースにアップグレードするなど)に従っていることを 確認する必要があります。
Step-by-Step Manual Upgrade
- 重要
- 常に新しいバックアップを作成し、すべてのサードパーティアプリを無効にすることから始めます
1. 既存のNextcloud Serverデータベース、データディレクトリ、config.phpファイルをバックアップします。 (See Backup, for restore information see Restoring backup)
2. https://nextcloud.com/changelog/ から対象のNextcloud Serverリリースを選択し、アーカイブファイル(tarballまたはzipアーカイブ)を現在のインストール以外の空のディレクトリにダウンロードします。
- 注意
- 一度に複数のメジャーバージョンを飛び越すことはできない(つまり、27->28はOKだが、27->29はNG)。
3. ダウンロードした tarball または zip アーカイブを解凍します - e.g.:
unzip nextcloud-[version].zip
(or)
tar -xjf nextcloud-[version].tar.bz2
4. Stop your Web server.
5. In case you are running a cron-job for nextcloud’s house-keeping disable it by commenting the entry in the crontab file:
crontab -u www-data -e
(Put a # at the beginning of the corresponding line.)
6. 現在のNextcloudディレクトリの名前をnextcloud-oldのように変更します。
7. Unpacking the new archive creates a new nextcloud directory populated with your new server files. Move this directory and its contents to the original location of your old server. For example /var/www/, so that once again you have /var/www/nextcloud.
- Copy the config/config.php file from your old Nextcloud directory to your new Nextcloud directory.
- If you keep your data/ directory in your nextcloud/ directory, move it from your old version of Nextcloud to your new nextcloud/. If you keep it outside of nextcloud/ then you don’t have to do anything with it, because its location is configured in your original config.php, and none of the upgrade steps touch it.
- If you are using 3rd party application, it may not always be available in your upgraded/new Nextcloud instance. To check this, compare a list of the apps in the new nextcloud/apps/ folder to a list of the of the apps in your backed-up/old nextcloud/apps/ folder. If you find 3rd party apps in the old folder that needs to be in the new/upgraded instance, simply copy them over and ensure the permissions are set up as shown below.
- If you have additional apps folders like for example nextcloud/apps-extras or nextcloud/apps-external, make sure to also transfer/keep these in the upgraded folder.
- If you are using 3rd party theme make sure to copy it from your themes/ directory to your new one. It is possible you will have to make some modifications to it after the upgrade.
- Adjust file ownership and permissions:
chown -R www-data:www-data nextcloud
find nextcloud/ -type d -exec chmod 750 {} \;
find nextcloud/ -type f -exec chmod 640 {} \;
- Restart your Web server.
- Now launch the upgrade from the command line using occ, like this example on Ubuntu Linux:
sudo -u www-data php occ upgrade
(!) this MUST be executed from within your nextcloud installation directory
- The upgrade operation takes a few minutes to a few hours, depending on the size of your installation. When it is finished you will see a success message, or an error message that will tell where it went wrong.
- Re-enable the nextcloud cron-job. (See step 4 above.)
crontab -u www-data -e
(Delete the # at the beginning of the corresponding line in the crontab file.)
Login and take a look at the bottom of your Admin page to verify the version number. Check your other settings to make sure they’re correct. Go to the Apps page and review the core apps to make sure the right ones are enabled. Re-enable your third-party apps.
以前のNextcloudリリース
過去のNextcloudリリースは Nextcloud Server Changelog でご覧ください。
トラブルシューティング
Occasionally, files do not show up after a upgrade. A rescan of the files can help:
sudo -u www-data php console.php files:scan --all
See the nextcloud.com support page for further resources.
Sometimes, Nextcloud can get stuck in a upgrade if the web based upgrade process is used. This is usually due to the process taking too long and encountering a PHP time-out. Stop the upgrade process this way:
sudo -u www-data php occ maintenance:mode --off
Then start the manual process:
sudo -u www-data php occ upgrade
If this does not work properly, try the repair function:
sudo -u www-data php occ maintenance:repair