Discourse를 서브도메인 간 이동 - 이게 될까요?

상황:

참고: 아래 두 인스턴스(서버 1 및 2) 모두 서로 다른 두 서버의 Docker 컨테이너에서 실행 중입니다. 두 서버 모두 Let’s Encrypt 인증서를 사용하여 HTTP 및 HTTPS(포트 80 및 443)를 실행하고 있습니다:

  1. 서버 1(IP 주소 1)에서 Discourse가 HTTP 및 HTTPS 모두 정상적으로 실행 중: discourse-test.example-domain.com
  2. 서버 2(IP 주소 2)에서 Discourse가 초기화 및 실행 중(추가 게시물이나 주제 없음), HTTP 및 HTTPS 모두: talktime.example-domain.com

목표:

서버 1(테스트)의 모든 데이터를 서버 2(프로덕션)로 이동하되, 도메인을 discourse-test.example-domain.com에서 talktime.example-domain.com으로 변경

제안된 방법:

  1. 서버 1의 Discourse 백업 생성
  2. 서버 2에 서버 1의 Discourse 백업 복원

이 방법이 완벽하게 작동할까요?

아니면 주의해야 할 함정이 있을까요?

도움 주시면 감사하겠습니다.

그렇게 하면 작동할 것입니다. 복원 후 다음을 실행하세요.

script/discourse remap //discourse-test.example-domain.com //talktime.example-domain.com

업데이트:

동작했습니다… 감사합니다.

하지만 어떤 이유로인지 아바타가 복원되지 않았습니다.

아마도 이것이 실패했기 때문일까요?

script/discourse remap //discourse-test.example-domain.com //talktime.example-domain.com

Traceback (most recent call last):

2: from script/discourse:4:in `<main>'

1: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'

/usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- thor (LoadError)

이렇게 하면 작동했습니다:

su discourse -c 'bundle exec script/discourse remap //discourse-test.example-domain.com //talktime.example-domain.com

… 그리고 정상적으로 실행되었습니다…

하지만 이 복원 과정에서 아바타는 이전되지 않았습니다(백업 시 이미지 포함을 선택했음).

업데이트:

서버 1에서 서버 2로 다음 경로에서 이미지를 이전하여 아바타를 작동하게 했습니다:

/var/discourse/shared/standalone/uploads/defaults