¿Mover Discourse a un servidor nuevo sin configurar primero la interfaz web?

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:

  1. Backup the existing site
  2. Install Discourse on the new server
  3. Configure Discourse using temporary values
  4. 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.

1 me gusta

I think what you want to know is that you can copy the backup to the new instance and then restore from the command line like

cd /var/discourse
./launcher enter app
discourse enable_restore
discourse restore

The last command will give you a list of available backups and you can copy-and-paste to start the restore.

5 Me gusta

@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.

1 me gusta

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.

6 Me gusta

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?

1 me gusta

Sounds like a bug

Yes. You can do that.

2 Me gusta

Disculpen por reabrir un tema antiguo / resuelto, pero pensé que esta aclaración debería estar aquí en lugar de en un tema nuevo.

Si quiero reubicar una instalación independiente de discourse que funcione del servidor antiguo al servidor nuevo, y asumiendo que docker está instalado y funcionando en el servidor nuevo, ¿podría ser tan simple como:

servidor-antiguo:

cd /var/discourse
./launcher stop app

servidor-nuevo:

rsync servidor-antiguo:/var/discourse /var
cd /var/discourse
./launcher rebuild app

Luego cambiar el DNS para que el nombre de dominio del foro apunte al servidor nuevo.

???

1 me gusta

Necesitas cambiar el antes de reconstruir. Y si vas a cambiar el nombre del host, es más fácil hacer una copia de seguridad y restaurarla. De lo contrario, necesitas seguir Cambiar el nombre de dominio o renombrar mi Discourse?.

Puedes mover la copia de seguridad con scp y restaurarla desde la línea de comandos.

1 me gusta

Hola, gracias. No habrá ningún cambio en el nombre del host/dominio. Simplemente me estoy mudando a un servidor nuevo y más grande. ¿Funcionará esta estrategia simple en ese caso?

Editar: Estoy editando mi publicación original anterior para intentar aclarar que el nombre de host del foro no cambiará, solo un nuevo servidor. Disculpas por la confusión.

2 Me gusta

Entiendo. Quizás debería haber un howto.

Sí, puedes usar rsync /var/discourse al nuevo servidor (y eso obtendrá los certificados SSL), y hacer una reconstrucción, y luego cambiar el DNS y debería funcionar.

2 Me gusta

Si está cambiando las especificaciones del servidor, se beneficiará de ejecutar discourse-setup, que maneja ciertos aspectos de la escalabilidad (trabajadores de unicorn y búferes compartidos de base de datos) y configurará automáticamente app.yml. Simplemente copiar carpetas no logrará esto.

2 Me gusta

Gracias Stephen,

Planeo ajustar esos parámetros manualmente en app.yml. Ejecutaré Discourse en paralelo con algunas otras aplicaciones basadas en Docker en el mismo servidor (como lo hago ahora), y por lo tanto las he ajustado a un nivel de uso de recursos un poco más bajo que donde la configuración las pondría según las especificaciones del servidor si Discourse fuera la única aplicación en ejecución.

2 Me gusta

Este tema se cerró automáticamente después de 2361 días. Ya no se permiten nuevas respuestas.