Move Discourse to a new server without setting up the web UI first?

Let’s say I want to move my Discourse site from one Amazon EC2 instance (e.g. t2.micro) to a larger instance (e.g. t2.medium), what is the correct procedure for this?

The only option I know about is:

  1. Backup the existing site
  2. Install Discourse on the new server
  3. Configure Discourse using temporary values
  4. Restore the backup

However, I’m thinking that the smart people at Discourse thought about this situation and there’s a way to restore a backup on a new installation without step 3.

Scouring the site, I wasn’t able to find a definitive answer.

I did look at Move your Discourse Instance to a Different Server, but the instructions seem to imply that a generic installation is already active on the target server and that you can log in and immediately perform a restore.

「いいね!」 1

I think what you want to know is that you can copy the backup to the new instance and then restore from the command line like

cd /var/discourse
./launcher enter app
discourse enable_restore
discourse restore

The last command will give you a list of available backups and you can copy-and-paste to start the restore.

「いいね!」 5

@pfaffman thank you for helping with this question, there’s one spot where I’m still a bit unclear.

On the new server (assuming the prerequisites are already installed), after cloning the Discourse repository, do I still need to run discourse-setup? I don’t believe it’s possible to issue the commands

until after setup completes. Or am I incorrect? If I am correct, this is the part I’m referring to, you have to essentially provide a set of default values before you are able to perform a restore.

「いいね!」 1

Yes, you still need to set up Discourse, but you can just use the same app.yml that you use on the old instance (or type them in to discourse-setup if that’s easier for you). But you have to have all of those values for a running Discourse anyway, so it’s not “temporary” values, but the values.

The command-line restore saves the you time of creating a temporary admin account that you’d use just to restore the backup.

「いいね!」 6

when I use the command line, everything goes well during the restore but at the end I get the following error:
Something went wrong while notifying user.

do you have any idea what I should do?

also is it possible to set up the new server by simply copying /var/discourse/ of the old server into the new one, rather than restoring a backup?

「いいね!」 1

Sounds like a bug

Yes. You can do that.

「いいね!」 2

古い/解決済みのトピックを再度開いてしまい申し訳ありませんが、この明確化は新しいトピックではなく、ここに追加すべきだと考えました。

動作中のスタンドアロンの Discourse インストールを old-server から new-server に移動したい場合、docker が new-server にインストールされていて動作していると仮定すると、次のように単純でよいでしょうか?

old-server:

cd /var/discourse
./launcher stop app

new-server:

rsync old-server:/var/discourse /var
cd /var/discourse
./launcher rebuild app

その後、DNS を変更して、フォーラムのドメイン名を new-server にポイントさせます。

???

「いいね!」 1

再構築する前に変更する必要があります。ホスト名を変更する場合は、バックアップと復元を行う方が簡単です。それ以外の場合は、Discourse のドメイン名を変更または名前を変更するには?に従う必要があります。

バックアップは scp で移動し、コマンドラインから復元できます。

「いいね!」 1

こんにちは、ありがとうございます。ホスト名/ドメイン名は変更されません。新しい、より大きなサーバーに移行するだけです。この単純な戦略は、その場合でも機能しますか?

編集:上記の元の投稿を編集して、フォーラムのホスト名が変更されないこと、単に新しいサーバーに移行することを明確にしようとしています。混乱させて申し訳ありません。

「いいね!」 2

なるほど。howto が必要かもしれませんね。

はい、/var/discourse を新しいサーバーに rsync して(これで SSL 証明書も取得できます)、再構築してから DNS を切り替えれば、うまくいくはずです。

「いいね!」 2

サーバーのスペックを変更する場合は、discourse-setup を実行するとメリットがあります。これはスケーリングの特定の側面(ユニコーンワーカーと DB共有バッファ)を処理し、app.yml を自動的に構成します。フォルダーをコピーするだけでは、これは達成できません。

「いいね!」 2

Stephenさん、ありがとうございます。

app.yml のパラメータは手動で調整する予定です。現在と同様に、同じサーバー上で他のいくつかの Docker ベースのアプリケーションと並行して Discourse を実行する予定なので、Discourse のみが実行されている場合のサーバー仕様に基づいた設定値よりも、リソース使用量を少し低めに調整しています。

「いいね!」 2

このトピックは2361日後に自動的に閉じられました。返信はもう許可されていません。