You’ll need to modify the script to import the data. The bbpress script imports only posts of a particular type (I likely don’t remember the right wordpress lingo). What kind of WP posts do you want to import? Which are topics and which are posts? Is there something like categories? Those are just a few questions you’ll need to answer by modifying the script. How to do that is beyond the scope of the support you’re likely to get here.
Edit:I’ve retired a few times and gotten closer… Now:
At step 2, mysql -u$MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < /backup/yourbackup.sql i get the error bash: /backups/yourstratapropertywordpress.sql: No such file or directory when it does exist (at least, in /var/backups it does)
If I jump ahead and try su discourse -c "bundle exec ruby script/import_scripts/bbpress.rb" anyway, I get the following result:
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...
Traceback (most recent call last):
5: from script/import_scripts/bbpress.rb:512:in `<main>'
4: from script/import_scripts/bbpress.rb:512:in `new'
3: from script/import_scripts/bbpress.rb:21:in `initialize'
2: from script/import_scripts/bbpress.rb:21:in `new'
1: from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `initialize'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in `connect': Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql2::Error::ConnectionError)
Thanks! I will take a look at the DB and the script and see if I can’t accomplish my purposes.
Good luck! I wrote at least a couple importers before I “learned” Ruby. If you have an understanding of SQL that could be acquired in an undergraduate course in the mid 1980s, you can likely pull it off. If you write the queries something such that the field names in the resulting data match what the script expect you might be able to change only the SQL.
@pfaffman I’d really appreciate your help here, I’m very stuck
I’m pretty slammed right now and this likely isn’t solved here. Email Jay@literatecomputing.com with a budget and I’ll do my best to come up with a solution.
This seems like your MySQL server is either not running or is not installed properly.
Success!
The post type should be post and needs to replace post_type topic. Tags were not brought over nor were the topics’ categories. All my posts were imported as an anonymous user, but it is certainly a decent start!
Glad you’re making headway!
Grazie per questa guida chiara, è stata fondamentale per la mia comprensione del processo di importazione invece di limitarsi a copiare/incollare comandi alla cieca.
Sto ancora cercando di capire il modo più veloce per importare un forum Drupal molto grande, e ho ancora l’impressione che le cose potrebbero essere ottimizzate nel mio caso per ridurre un po’ i tempi di inattività quando eseguirò la migrazione finale del forum di produzione. Potrei essere un po’ un “graybeard” (vecchio saggio), ma non sono ancora del tutto convinto del paradigma Docker/containerizzazione. Sono sicuro di aver letto da qualche parte che c’è stato un bug di Docker a un certo punto che causava prestazioni massicciamente più lente delle istanze MySQL containerizzate. Sul forum di Docker sto vedendo questo report, ma non sono sicuro se sia ancora rilevante. Inoltre, potrebbe non essere rilevante nel mio caso perché sto eseguendo Debian invece di Ubuntu sull’host.
Un’altra opzione potrebbe essere quella di installare MySQL o MariaDB sul sistema operativo host al di fuori del container?
E senza entrare nei dettagli, che dire dell’ottimizzazione di my.cnf con alcuni suggerimenti da MySQLTuner? La configurazione Docker standard che funziona universalmente per tutte le istanze non può essere ottimale con le sue istanze di buffer pool e le dimensioni dei key buffer, che fanno una differenza enorme su un database di produzione dedicato.
Ciao. Grazie per questa soluzione. Ho avuto problemi con le gemme come hai menzionato nel tuo articolo, quindi non vedo l’ora di far funzionare questo. Questo metodo funziona per migrare un forum Wordpress bbpress (ospitato su DreamPress) a un’istanza Discourse (ospitata su Digital Ocean)?
Sto usando il droplet basato su Ubuntu di Digital Ocean e il terminale/console web. La mia prima domanda è cosa ci si aspetta che accada quando eseguo /var/discourse/launcher stop app /var/discourse/launcher rebuild import? Il terminale/console web dovrebbe chiudersi. Ho provato a farlo, ma il file import.yml non sembra salvarsi. Torna al suo stato predefinito.
Inoltre, qualcuno può chiarire se devo eseguire il passaggio opzionale 2 nella mia configurazione?
Grazie mille in anticipo.
PS: Sono disposto a pagare qualcuno per farlo, ma il mio budget è limitato a $ 200.
Forse vorresti pubblicarlo in Marketplace.