Migra un forum del plugin bbPress di WordPress su Discourse

It sounds like it.

And my vbulletin import script, which does handle non-linked attachments, doesn’t look for them in that table, so you’ll need some custom code to deal with that, even after I get around to submitting a PR with my script.

EDIT: and it also means that I think that even if they were linked in-post they still wouldn’t work, since they aren’t where the script expects them in the database.

1 Mi Piace

Good news! I don’t know exactly how the import script handles it but it does! After making the files accessible to the import container and digging a bit in the script I found that it works. The only problem I had was that the file name which I tested it on contained an ä and thus some weird encoding shit prevented the script from finding the file actually. After fixing the filename the import worked and the attachment appeared at the post!

Thanks a lot for all the tips! :beers:

1 Mi Piace

Awesome! Glad the magic worked for you! (Oh! I and I see now that I was looking at the vBulletin script and not bbPress, hence my confusion. That explains why I couldn’t find the table!)

1 Mi Piace

Hi
I got an error after launching the IMPORT bundle exec command:

Using unicorn 5.5.1
Using webmock 3.7.6
Using webpush 1.0.0
Using yaml-lint 0.0.10
Bundle complete! 130 Gemfile dependencies, 214 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Traceback (most recent call last):
        31: from scripts/import_scripts/bbpress.rb:4:in `<main>'
        30: from scripts/import_scripts/bbpress.rb:4:in `require'
        29: from /var/discourse/scripts/import_scripts/base.rb:16:in `<top (required)>'
        28: from /var/discourse/scripts/import_scripts/base.rb:16:in `require_relative'
        27: from /var/discourse/config/environment.rb:7:in `<top (required)>'
        26: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/railtie.rb:190:in `method_missing'
        25: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/railtie.rb:190:in `public_send'
        24: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:363:in `initialize!'
        23: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:60:in `run_initializers'
        22: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
        21: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
        20: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
        19: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `call'
        18: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each'
        17: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
        16: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
        15: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        14: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
        13: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:61:in `block in run_initializers'
        12: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `run'
        11: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `instance_exec'
        10: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/application/bootstrap.rb:73:in `block in <module:Bootstrap>'
         9: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
         8: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
         7: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
         6: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
         5: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
         4: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
         3: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ember-rails-0.18.5/lib/ember/rails/engine.rb:19:in `block in <class:Engine>'
         2: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:in `load_missing_constant'
         1: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
/home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:60:in `block in load_missing_constant': uninitialized constant Sprockets::Engines (NameError)
        32: from scripts/import_scripts/bbpress.rb:4:in `<main>'
        31: from scripts/import_scripts/bbpress.rb:4:in `require'
        30: from /var/discourse/scripts/import_scripts/base.rb:16:in `<top (required)>'
        29: from /var/discourse/scripts/import_scripts/base.rb:16:in `require_relative'
        28: from /var/discourse/config/environment.rb:7:in `<top (required)>'
        27: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/railtie.rb:190:in `method_missing'
        26: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/railtie.rb:190:in `public_send'
        25: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/application.rb:363:in `initialize!'
        24: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:60:in `run_initializers'
        23: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
        22: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
        21: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
        20: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `call'
        19: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each'
        18: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
        17: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
        16: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        15: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
        14: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:61:in `block in run_initializers'
        13: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `run'
        12: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/initializable.rb:32:in `instance_exec'
        11: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/application/bootstrap.rb:73:in `block in <module:Bootstrap>'
        10: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
         9: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:51:in `each'
         8: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
         7: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
         6: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
         5: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-6.0.1/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
         4: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ember-rails-0.18.5/lib/ember/rails/engine.rb:19:in `block in <class:Engine>'
         3: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `load_missing_constant'
         2: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `rescue in load_missing_constant'
         1: from /home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
/home/kenaddams42/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/active_support.rb:79:in `block in load_missing_constant': uninitialized constant Sprockets::Engines (NameError)
root@sd-114000:/var/discourse# ~

Any idea please ?
Thank you :wink:

Grazie per questo tutorial, @vinothkannans!

Sono bloccato mentre modifico bbpress.rb

Dopo aver eseguito sudo nano script/import_scripts/bbpress.rb si apre l’editor del file, ma quando provo a salvare, viene visualizzato il messaggio “nessun file o directory”:

È un’installazione completamente nuova.

Grazie mille,

Jake

Nella guida sopra ho utilizzato la directory /var/discourse per installare l’ambiente di sviluppo di Discourse. Se l’hai installato in una posizione diversa, assicurati di eseguire cd su quella directory (~/discourse nella maggior parte dei casi) invece di quella sopra prima di eseguire il comando sudo nano script/import_scripts/bbpress.rb.

3 Mi Piace

Ciao,

non vedo il percorso “script” nella cartella /var/discourse.

  • Ho provato con una nuova istanza fresca dal Marketplace di DigitalOcean.
  • Ho provato con l’installazione ufficiale Docker di Discourse.

Ecco come appare /var/discourse/scripts/:


Cordiali saluti

È corretto.

Dovrai configurare un ambiente di sviluppo oppure seguire le istruzioni presenti in altri argomenti sull’importazione per sapere come eseguire lo script di importazione all’interno di un container di produzione.

Infine ho trovato Use an import script that requires MySQL per la parte mancante.

Grazie

1 Mi Piace

@vinothkannans Sto cercando di migrare da WPForo a Discourse e lo script/codice è oltre le mie capacità. Potresti (o chiunque altro) aiutarmi con questo? Grazie.

Potresti avere più fortuna postando in Marketplace. Ci sono diverse persone che monitorano quella categoria che possono aiutarti.

2 Mi Piace

Abbiamo anche la categoria Migration per domande specifiche sulla migrazione. :+1:

3 Mi Piace

Sto riscontrando il seguente errore quando seguo la guida e arrivo al punto in cui eseguo lo script di importazione. Ho installato discourse come da queste istruzioni

myuser@tmp-discourse:~/discourse$ IMPORT=1 bundle &amp;&amp; IMPORT=1 bundle exec ruby script/import_scripts/bbpress.rb

[!] Si è verificato un errore durante l'analisi di `Gemfile`: Non è possibile specificare lo stesso gem due volte con diversi requisiti di versione.
Hai specificato: sqlite3 (~&gt; 1.3, &gt;= 1.3.13) e sqlite3 (&gt;= 0). Bundler non può continuare.

 #  da /home/myuser/discourse/Gemfile:251
 #  -------------------------------------------
 #  group :generic_import, optional: true do
 &gt;    gem "sqlite3"
 #    gem "redcarpet"
 #  -------------------------------------------

L’ho fatto funzionare modificando questo nel Gemfile

# NOTA: in modalità import la versione di sqlite può contare molto, quindi la fissiamo a una specifica
#gem "sqlite3", "~> 1.3", ">= 1.3.13"
  gem "sqlite3"

Ho anche dovuto installare questo pacchetto nella mia installazione di Ubuntu 22.04 LTS

sudo apt install freetds-dev