Restore backup without reconfiguring Discourse

(Martial) #1

It will be great if there is a way to restore a backup without reconfiguring the Discourse from the beginning.

For now, the differents steps to restore a backup from a server to another are :

1 - make a backup
2 - reinstall Discourse with ./discourse-setup and complete the questions : host, smtp, port etc
3 - configure SSL
4 - load the backup

Why should I complete the step 2 (and 3) if all the data are replace by the backup two minutes laters.

Proposition :

The discourse-setup script have an option where a backup is passed in parameter to direclty install the Docker and Discourse regarding the backup variables (host, smtp etc)

(Rafael dos Santos Silva) #2

Because the backup doesn’t contain your environment variables (STMP, etc) and certificates (SSL).

(Martial) #3

So if i do not answer the same way (host, port, smtp) on the new installation and then I load the backup.

The forum will work and take the new parameters in account?

(Jay Pfaffman) #4

Mostly. You may need to rebake as described here.

(ljpp) #5
  1. Backup
  2. Transfer your app.yml to new server, comment out Lets Encrypt lines
  3. Bootstrap
  4. Restore
  5. Un-comment Lets Encrypt
  6. Rebuild
  7. Transfer the domain.
  8. Reboot server

Thats my flow and been doing it a lot during this winter.

(Jay Pfaffman) #6

You need to re-point the domain to the new IP before you rebuild with let’s encrypt. Let’s Encrypt won’t get a certificate unless the domain name resolves to the IP requesting the certificate.

(ljpp) #7

You might think so, wouldn’t you. But at least in a case when you trasfer an existing site, which has already has Let’s Encrypt, it works.

I did add step 8. to reboot. Not sure at what point does take care of it, but site works and certificates are there. Just moved one site today.

(Jay Pfaffman) #8

Ha! Interesting. I’d argue that’s a bug in acme, but this isn’t the place for that. :slight_smile:

(ljpp) #9

I cant now remember for 100% sure, but I think the rebuild generates some of the certificate related files, but the actual *.cer appears after the domain is transferred and system rebooted.

But can’t say for sure, since I did not really make note of it at the time. I was just happy to see the site go live and certs being in place with very little down time.


Does that mean letsencrypt issues a new cert automatically Everytime?

(Jay Pfaffman) #11

If it needs to. If there is a valid CERT it’ll is it.