Nodebb a Discourse

Necesito un poco de orientación sobre la migración de NodeBB a Discourse. Vi este hilo y noté que @eatcodetravel creó el script. No logro entender cómo se ejecutan estos scripts. ¿Necesito instalar Redis en el servidor donde se ejecuta Discourse también para la importación?

Agradezco su ayuda.

Hey @michael,

You need redis to run discourse. The nodebb importer is only available if you use redis as your nodebb database. Here is how I would do the migration.

  1. Setup a discourse environment (it can be your machine or an instance in the cloud)
  2. Change the nodebb importer configuration (take a look at the code, there’s comments on what you need to replace)
  3. Run the importer with bundle exec ruby script/import_scripts/nodebb/nodebb.rb from the discourse folder
  4. (Optional) make a backup of discourse and restore it where you need it

The importer will connect to your nodebb redis database and copy everything over discourse, the time it takes is related to the amount of data you have. Also, you need to wait for discourse to finish processing jobs before you do the backup, go to /sidekiq route as an admin and you will see the pending/completed jobs

Hope it helps

6 Me gusta

¡Gracias!

Tengo Discourse ejecutándose a través de Digital Ocean + Docker. Edité script/import_scripts/nodebb/nodebb.rb dentro del contenedor y modifiqué ATTACHMENT_DIR para incluir el directorio donde tengo NodeBB. También coloqué el directorio de NodeBB dentro del contenedor.

¿Qué hay del archivo volcado de Redis?

Oh I see there’s no comment in the redis connection parameters, I’ll open a PR for that

Here’s where you put the connection parameters for nodebb redis discourse/script/import_scripts/nodebb/nodebb.rb at main · discourse/discourse · GitHub

1 me gusta

Here are the quick steps I took when I first ran the importer when it was under development. I can also attest to it working wonderfully.

  • Setup a dev environment of Discourse per Beginners Guide to Install Discourse on Ubuntu for Development
  • Stopped redis
  • Copied the dump.rdb file from NodeBB and overwrote the redis dump file that exists
  • Copied the uploads directory from NodeBB to the dev box
  • Edited the nodebb.rb file to point to the copied uploads directory
  • Ran the importer bundle exec ruby script/import_scripts/nodebb/nodebb.rb

I do recommend taking a look at Preparing for and undertaking a platform migration, it has some great steps for validation and planning a migration.

5 Me gusta

Gracias @eatcodetravel y @tehspaceg

Después de ejecutar exec ruby script/import_scripts/nodebb/nodebb.rb obtengo lo siguiente:

\u003e No hay conexión a la base de datos, ¡no se pueden recuperar la configuración del sitio! (normal al ejecutar db:create)

Moví dump.rdb desde el servidor NodeBB a mi contenedor Docker de Discourse en /shared/redis_data.

¿Alguna idea? :thinking:

Una suposición audaz aquí. Creo que no está importando el archivo de volcado de Redis.

Estoy atascado. Soy nuevo en Redis y, aunque he aprendido mucho, no logro descifrar esta última pieza del rompecabezas.

I neglected to write down the actual paths to files, I just had those notes from when I did it.

Are you using a dev environment outside of the Docker image? it might make it easier ensure redis is stopped when you replace the dump.rdb file.

Edit: I wrote this before finishing coffee. So the reason I suggest that you need to have redis stopped is that I don’t think it will read from the dump file until after it has been stopped (redis stores the database in memory and periodically writes to the dump.rdb file)

2 Me gusta

He intentado detener Redis, pero parece seguir ejecutándose sin importar lo que haga. He terminado el proceso una docena de veces, pero aún así sigue corriendo. :confused:

Vuelvo a intentarlo. El mismo error sigue apareciendo e incluye lo siguiente:

\u003e FATAL: Falló la autenticación peer para el usuario “discourse” (PG::ConnectionBad)

¿Debería ejecutar esto dentro del contenedor Docker? Eso es lo que he estado haciendo como root. También lo intenté como discourse, lo que resultó en:

\u003e FATAL: la base de datos “discourse_development” no existe (ActiveRecord::NoDatabaseError)

No estoy seguro de qué podría estar haciendo mal.

No, as per instructions you should:

3 Me gusta

Eso fue todo. No sabía que Docker no podía ser utilizado en absoluto.

1 me gusta