Move Discourse Between Subdomains - Will This Work?

Situation:

Note: Both instances below (server 1 and 2) running in docker containers on two different servers. Both servers running on both HTTP and HTTPS (ports 80 and 443) with Let’s Encrypt certs:

  1. Discourse fully running on server 1 with IP address 1, both HTTP and HTTPS: discourse-test.example-domain.com
  2. Discourse initialized and running (no additional posts or topics yet) on server 2 with IP address 2, both HTTP and HTTPS: talktime.example-domain.com

Goal:

Move all from server 1 (testing) to server 2 (production) changing domain from discourse-test.example-domain.com to talktime.example-domain.com

Proposed Approach:

  1. Take a backup of Discourse on server 1
  2. Restore backup of Discourse (from server 1) on server 2

This should work flawlessly?

Or is there some gotacha’ to look out for?

Thanks for any pointers.

2 Likes

That should work. Do a

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

after the restore.

5 Likes

Update:

Worked… thanks.

But the avatars and did not restore, for some reason.

Maybe because this fails ?

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)
1 Like

This worked:

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

… and ran OK…

But the avatars not did port over in this restore process (we selected include images in the backup).

Update:

We got the avatars to work by porting over the images from server 1 to server 2 from here:

/var/discourse/shared/standalone/uploads/defaults
2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.