Migrating over to a new instance in new hosting provider

AI-generated summary

In a discussion about migrating a Discourse forum from AWS to DigitalOcean with minimal downtime, owrh describes challenges encountered when trying to set up SSL via Let’s Encrypt on the new instance using the same domain as the live site, and also when restoring a backup without SSL. pfaffman suggests copying the letsencrypt and ssl directories from the old instance to the new one, noting that while it may be tricky, it should work — or alternatively, rebuild the site after the DNS switch. D8vid proposes adapting the INSTALL-cloud.md instructions by copying configuration files and using ./discourse-setup, then restoring via the web UI before switching DNS, and asks for pre-switch testing recommendations. pfaffman clarifies that ./launcher rebuild app is sufficient instead of discourse-setup, and recommends testing by pointing local DNS to the new server beforehand. D8vid thanks the contributors for the guidance. The thread reflects a collaborative troubleshooting effort focused on preserving domain and SSL configuration during migration.

We have a forum running in AWS, on a custom domain with SSL via LetsEncrypt and we’re looking to move to Digital Ocean, ideally without downtime. Is there a recommended best practice as I’ve encountered a variety of problems?

I first tried setting up the new instance and enabling LetsEncrypt but this caused all sorts of problems (e.g. SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: TRUSTED CERTIFICATE) – presumably because I was trying to set up the new instance using the same domain name in the configuration as the existing live site.

I then tried setting up the instance without SSL (but with the instance configured on the same domain name) and restoring a backup from the live site. This time the restore process failed with what looked like issues around the domain name.

Setting up a new instance on a new domain is really easy (thank you! :pray:) but trying to create a new instance that I can then just do a DNS switch over to in order to migrate appears to be really hard. Unless, that is, I’m just doing it wrong!

Any help would be appreciated.

I’m not making any promises, but if the current site is a standard install, you can copy over your the letsencrypt and ssl directories and those certs should get copied over and it’ll rebuild just fine. It can be a bit tricky, though.

Worst case, you’ll need to rebuild the site after the DNS switch.

Would INSTALL-cloud.md instructions work modified like this, on the new target host?:

sudo -s
git clone GitHub - discourse/discourse_docker: A Docker image for Discourse · GitHub /var/discourse
cd /var/discourse
[copy letsencrypt, ssl directories & containers/app.yml from current running instance]
./discourse-setup

Then on to using the web UI to restore from backup, and DNS switch?

Any recommendations for tests to perform before the DNS switch?

Many thanks for any helpful pointers!

You don’t need discourse-setup, just ./launcher rebuild app. You should be able to change your local DNS to point it to the new server and have it work.

Excellent, thanks for the tips!