Nodebb a Discourse

Ho bisogno di una piccola guida sulla migrazione da NodeBB a Discourse. Ho visto questa discussione e ho notato che @eatcodetravel ha creato lo script. Non riesco a capire come questi script vengono eseguiti. Devo installare Redis anche sul server su cui è in esecuzione Discourse per l’importazione?

Apprezzo il vostro aiuto.

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 Mi Piace

Grazie!

Sto eseguendo Discourse tramite Digital Ocean e Docker. Ho modificato script/import_scripts/nodebb/nodebb.rb all’interno del container e ho aggiornato ATTACHMENT_DIR per includere la directory dove si trova NodeBB. Ho anche inserito la directory di NodeBB all’interno del container.

E il file di dump di 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 Mi Piace

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 Mi Piace

Grazie @eatcodetravel e @tehspaceg

Dopo aver eseguito exec ruby script/import_scripts/nodebb/nodebb.rb ottengo quanto segue:

Nessuna connessione al db, impossibile recuperare le impostazioni del sito! (normale quando si esegue db:create)

Ho spostato dump.rdb dal server NodeBB al mio contenitore Docker di Discourse in /shared/redis_data.

Qualche idea? :thinking:

Una supposizione a casaccio qui. Penso che non stia importando il file di dump di Redis.

Sono bloccato. Sono nuovo di Redis e ho sicuramente imparato molto, ma non riesco a capire quest’ultimo pezzo del puzzle.

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 Mi Piace

Ho provato a fermare Redis, ma sembra che continui a essere in esecuzione, non importa cosa faccia. Ho terminato il processo una dozzina di volte, ma continua a funzionare. :confused:

Sto riprovando di nuovo. Lo stesso errore appare ancora e include questo:

FATAL: Autenticazione peer fallita per l’utente “discourse” (PG::ConnectionBad)

Dovrei eseguirlo all’interno del contenitore Docker? È quello che ho fatto finora come root. Ho anche provato come discourse, il che ha portato a:

FATAL: il database “discourse_development” non esiste (ActiveRecord::NoDatabaseError)

Non sono sicuro di cosa potrei stare facendo di sbagliato.

No, as per instructions you should:

3 Mi Piace

Era tutto qui. Non sapevo che Docker non potesse essere usato per nulla.

1 Mi Piace