Migrate/Convert WP Posts to Discourse Topics

I have a Knowledge Base plugin on WordPress whose custom posts I’d like to replace with self-hosted Discourse Topics, coded in markdown. It would be ideal if the tags could be migrated as well.

@angus mentioned in my previous topic that there might be a migration script that could help with this. Any tips?

Thanks!

The place to start is with a script that’s closest to your needs in this folder

In particular you might find the Generic Database script useful. Also have a look through Topics tagged migration to see if others have done a migration similar to yours.

After you’ve reviewed some of those scripts and topics and gotten to grip with what this involves, come back here to ask us if you have specific questions or get stuck with something and we can help you through it.

2 Likes

Thanks very much!

I’m also looking to migrate a Vanilla Forum v3 to Discourse. I seem to have exported everything find with the Vanilla porter. But I get this error when running the import script. Any ideas?

discourse@ip-172-26-0-201-app:/var/www/discourse$ RAILS_ENV=production ruby script/import_scripts/vanilla.rb /shared/uploads/export.txt
Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...
parsing file...
reading file...
Traceback (most recent call last):
    5: from script/import_scripts/vanilla.rb:260:in `<main>'
    4: from /var/www/discourse/script/import_scripts/base.rb:47:in `perform'
    3: from script/import_scripts/vanilla.rb:22:in `execute'
    2: from script/import_scripts/vanilla.rb:42:in `parse_file'
    1: from script/import_scripts/vanilla.rb:77:in `read_file'
script/import_scripts/vanilla.rb:77:in `gsub': invalid byte sequence in UTF-8 (ArgumentError)
discourse@ip-172-26-0-201-app:/var/www/discourse$
1 Like

Nevermind, I see this other topic with the exact same problem: Error importing from vanilla: invalid byte sequence in UTF-8 - support - Discourse Meta

I’ll have to tinker with the database encoding.

1 Like