Backup Prod -> Snap -> Build Test -> Change Address

Hello everyone,
I’m currently struggling to implement my goal despite using AI.

Our Discourse is running on Hetzner. The address could be forum.thisIsMyDomain.com.
There I make a backup and then a snapshot from the backup.

I have another Hetzner server for testing purposes, and I’m rebuilding it from the snapshot. The server logically has a different IP and address, e.g., dev.thisIsMyDomain.com.

How can I get the dev/test instance running?
nano /var/discourse/containers/app.yml

DISCOURSE_HOSTNAME: adjust to the new name

This doesn’t seem to be enough.
However, I absolutely do not want to perform a rebuild, but rather get a 1:1 copy running in the first step.

Has anyone gained experience with this and can give me a tip on how to proceed? Thank you all for your time.

Richarde

Hi there, did you follow this guide to restoring from backups?

(Also see Restore a Discourse backup manually for development but I don’t think that’s relevant?)

Thank you for your answer.

No, I tried it my way and am looking for a solution for that way.

1 Like

You can try changing the hostname and doing a ‘./launcher rebuild app’`.

But since the hostname has changed, a bunch of stuff in the database also needs to be changed. The easiest way is to restore a backup. There once was a topic about how to change the hostname; I don’t see it, but I might not have looked hard enough. Or maybe it wwas deleted because it’s much easier and more reliable to restore the backup.

You might be able to do a `./launcher destroy app;./launcher start app` and then restore the backup from the command line.

What I would recommend is Move a Discourse site to another VPS with rsync and Set up a staging server

Then what you’d do is push your docker image somewhere, and then use ./launcher start-cmd app to see how to start it. So you’ll need to figure out enough about docker to push the image to a private repo and start it up and then restore the backup.

I would like to mark this attempt as officially failed :slight_smile:
I tried a lot, but it seems impossible (for me), so I’m giving up on this approach.

Just to inform everyone who might have the same idea.
If I manage to solve my problem in another way as a beginner, I’ll gladly post my working solution here.

actually this works.

don´t know why it didn´t before, but right now that´s how i do it.

  • Snap of Prod.
  • Rebuild Dev from Prod Snap
  • change app.ylm “DISCOURSE_HOSTNAME” to new DevAdr
  • Rebuild App

you should not do this to often in a week, as there is a rate limit for ssl trusted certificates. Best practise:
snap Prod, rebuild Dev, Snap Dev

Every Rebuild on same Address, dosn´t lead to new creation of ssl certificate.

This is the easy way for me to create a test server, just a few clicks.

1 Like