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.

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.

@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.

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.

명령줄을 사용할 때 복원 과정은 잘 진행되지만, 마지막에 다음과 같은 오류가 발생합니다:
Something went wrong while notifying user.

어떤 조치를 취해야 할지 아이디어가 있으신가요?

또한, 백업을 복원하는 대신 기존 서버의 /var/discourse/ 디렉토리를 새 서버로 복사하는 방식으로 새 서버를 설정할 수 있나요?

버그인 것 같습니다

네. 그렇게 하셔도 됩니다.

이미 해결된 오래된 주제를 다시 여는 것이 죄송하지만, 이 명확한 설명은 새 주제보다는 여기에 있는 것이 더 적절하다고 생각했습니다.

작동 중인 독립형 Discourse 설치 환경을 old-server에서 new-server로 이전하고 싶고, new-server에 Docker가 설치되어 정상적으로 작동한다고 가정할 때, 다음과 같이 간단하게 처리할 수 있을까요?

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로 가리키도록 합니다.

???

재구축 전에 [설정]을 변경해야 합니다. 그리고 호스트 이름을 변경할 예정이라면, 백업 후 복원하는 것이 더 쉽습니다. 그렇지 않다면 도메인 이름 변경 또는 Discourse 이름 변경 방법을 따라야 합니다.

백업 파일은 scp를 사용하여 이동하고, 명령줄에서 복원할 수 있습니다.

안녕하세요, 감사합니다. 호스트/도메인 이름은 변경되지 않습니다. 단순히 더 큰 새 서버로 이전하는 것입니다. 이 경우에도 이 간단한 전략이 작동할까요?

수정: 포럼의 호스트네임은 변경되지 않고 새 서버로만 이전한다는 점을 더 명확히 하기 위해 위 원문을 수정합니다. 혼동을 드려 죄송합니다.

그렇군요. #howto를 만드는 것이 좋을 것 같습니다.

네, /var/discourse를 새 서버로 rsync하면 됩니다(이렇게 하면 SSL 인증서도 함께 복사됩니다). 그 다음 rebuild를 수행하고 DNS를 전환하면 정상적으로 작동할 것입니다.

서버 사양을 변경하는 경우, discourse-setup을 실행하는 것이 유리합니다. 이 도구는 스테이킹의 특정 측면(unicorn 워커 및 DB 공유 버퍼)을 처리하고 app.yml을 자동으로 구성합니다. 단순히 폴더를 복사하는 것만으로는 이러한 작업을 수행할 수 없습니다.

Stephen, 감사합니다.

저는 app.yml에서 해당 매개변수를 수동으로 조정할 계획입니다. 현재와 마찬가지로 같은 서버에서 Discourse와 다른 Docker 기반 앱 몇 개를 병렬로 실행할 예정이므로, Discourse만 단독으로 실행되는 경우 서버 사양에 따라 설정이 적용하는 수준보다 리소스 사용량을 약간 낮게 조정해 두었습니다.