Mover o Discourse para um novo servidor sem configurar a interface web primeiro?

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 curtida

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 curtidas

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

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 curtidas

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 curtida

Sounds like a bug

Yes. You can do that.

2 curtidas

Desculpe reabrir um tópico antigo / resolvido, mas pensei que essa clarificação deveria estar aqui em vez de um novo tópico.

Se eu quiser realocar uma instalação independente de discourse funcionando do servidor-antigo para o servidor-novo, e assumindo que o docker está instalado e funcionando no servidor-novo, poderia ser tão simples quanto:

servidor-antigo:

cd /var/discourse
./launcher stop app

servidor-novo:

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

Então mude o DNS para apontar o nome de domínio do fórum para o servidor-novo.

???

1 curtida

Você precisa alterar o antes de reconstruir. E se você for alterar o nome do host, é mais fácil fazer backup e restaurar. Caso contrário, você precisa seguir Alterar o nome de domínio ou renomear meu Discourse?.

Você pode mover o backup com scp e restaurar da linha de comando.

1 curtida

Oi, obrigado. Não haverá alteração no nome do host/domínio. Estou simplesmente mudando para um servidor novo e maior. Essa estratégia simples funcionará nesse caso?

Editar: Estou editando minha postagem original acima para tentar deixar mais claro que o nome do host do fórum não mudará - apenas um novo servidor. Desculpe pela confusão.

2 curtidas

Entendi. Talvez devesse haver um howto.

Sim, você pode usar rsync /var/discourse para o novo servidor (e isso obterá os certificados SSL), e fazer uma reconstrução, e então trocar o DNS e deve funcionar.

2 curtidas

Se você estiver alterando as especificações do servidor, você se beneficiará da execução do discourse-setup - ele lida com certos aspectos de dimensionamento (trabalhadores unicorn e buffers compartilhados de banco de dados) e configurará automaticamente o app.yml. Apenas copiar pastas não alcançará isso.

2 curtidas

Obrigado, Stephen,

Planejo ajustar esses parâmetros manualmente em app.yml. Estarei executando o Discourse em paralelo com alguns outros aplicativos baseados em Docker no mesmo servidor (como estou fazendo agora), e por isso os ajustei para um nível de uso de recursos um pouco mais baixo do que a configuração inicial colocaria com base nas especificações do servidor se o Discourse fosse o único aplicativo em execução.

2 curtidas

Este tópico foi automaticamente fechado após 2361 dias. Novas respostas não são mais permitidas.