Let’s say I want to move my Discourse site from one Amazon EC2 instance (e.g. t2.micro) to a larger instance (e.g. t2.medium), what is the correct procedure for this?
The only option I know about is:
Backup the existing site
Install Discourse on the new server
Configure Discourse using temporary values
Restore the backup
However, I’m thinking that the smart people at Discourse thought about this situation and there’s a way to restore a backup on a new installation without step 3.
Scouring the site, I wasn’t able to find a definitive answer.
I did look at Move your Discourse Instance to a Different Server, but the instructions seem to imply that a generic installation is already active on the target server and that you can log in and immediately perform a restore.
@pfaffman thank you for helping with this question, there’s one spot where I’m still a bit unclear.
On the new server (assuming the prerequisites are already installed), after cloning the Discourse repository, do I still need to run discourse-setup? I don’t believe it’s possible to issue the commands
until after setup completes. Or am I incorrect? If I am correct, this is the part I’m referring to, you have to essentially provide a set of default values before you are able to perform a restore.
Yes, you still need to set up Discourse, but you can just use the same app.yml that you use on the old instance (or type them in to discourse-setup if that’s easier for you). But you have to have all of those values for a running Discourse anyway, so it’s not “temporary” values, but the values.
The command-line restore saves the you time of creating a temporary admin account that you’d use just to restore the backup.
when I use the command line, everything goes well during the restore but at the end I get the following error: Something went wrong while notifying user.
do you have any idea what I should do?
also is it possible to set up the new server by simply copying /var/discourse/ of the old server into the new one, rather than restoring a backup?
Mi scuso per aver riaperto una discussione vecchia/risolta, ma pensavo che questa chiarificazione dovesse essere inserita qui piuttosto che in un nuovo argomento.
Se voglio spostare un’installazione di discourse stand-alone funzionante da vecchio-server a nuovo-server, e supponendo che docker sia installato e funzionante su nuovo-server, potrebbe essere semplice come:
vecchio-server:
cd /var/discourse
./launcher stop app
nuovo-server:
rsync vecchio-server:/var/discourse /var
cd /var/discourse
./launcher rebuild app
Quindi cambiare il DNS per puntare il nome di dominio del forum a nuovo-server.
Ciao, grazie. Non ci sarà alcun cambiamento nel nome host/dominio. Mi sto semplicemente spostando su un nuovo server più grande. Questa semplice strategia funzionerà in quel caso?
Modifica: sto modificando il mio post originale sopra per cercare di chiarire che l’hostname del forum non cambierà, ma solo un nuovo server. Mi scuso per la confusione.
Sì, puoi usare rsync per copiare /var/discourse sul nuovo server (e questo includerà anche i certificati SSL), eseguire una ricostruzione, quindi cambiare il DNS e dovrebbe funzionare.
Se stai modificando le specifiche del server, trarrai vantaggio dall’esecuzione di discourse-setup: gestisce determinati aspetti dello scaling (worker unicorn e buffer condivisi del database) e configurerà automaticamente app.yml. La semplice copia di cartelle non otterrà questo risultato.
Ho intenzione di modificare manualmente quei parametri in app.yml. Eseguirò discourse in parallelo ad altre applicazioni basate su docker sullo stesso server (come sto facendo ora), e quindi li ho ottimizzati a un livello di utilizzo delle risorse leggermente inferiore rispetto a dove setup li imposterebbe in base alle specifiche del server se discourse fosse l’unica applicazione in esecuzione.