Migrating to Discourse from another Forum software


(Arpit Jalan) #1

So you want to migrate your existing forum to Discourse? That’s great! Let’s get started!

We recommend setting up a development environment on your machine (or inside a virtual machine) and run the import there instead of inside the docker container. Then you will be able to create a backup and import it on your production instance. Refer the OS X or Ubuntu installation guide for development.

We highly recommend to read the script before performing import, as the script is meant for developers, and you will almost certainly need to modify the script file before beginning. Near the top of the scripts, a connection is made to the database containing the source data; so at a minimum, the connection settings will need to be changed. You may also want to change the SQL queries that fetch the data to import into Discourse. For example, if you want to exclude really old posts, you can add a condition to the where clauses.

After reviewing and modifying, to run the SomeForumSoftware import script you will do:

cd path/to/your/discourse_folder
bundle exec ruby script/import_scripts/some_forum_software.rb

This process will be similar for other import scripts.

Discourse currently provides import scripts for a wide range of forum software, including Vanilla, phpBB3, SMF2, bbPress, VBulletin, and others.

Many of these scripts have dedicated tutorials. You can find them here.

The exhaustive list of import scripts is available under the script/import_scripts folder on GitHub.

Improving import and export support
Importing bbPress into Discourse
Error Trying to Start Import Process - Xenforo to Discourse
Migrating legacy data from other applications
Migrating from Jive Clearspace to Discourse
(Erlend Sogge Heggen) #2

Which version of bbPress is bbpress.rb targeted at? Legacy bbPress (standalone) or WordPress bbPress (plugin)?

Judging by this alternative import script for bbPress-to-Discourse the migration path appears to be quite similar, but it’d still be best to keep the scripts separate.

(Arpit Jalan) #3

Judging from queries, the bbpress.rb script seems to be for WordPress bbPress. @neil can you confirm?

(Neil Lalonde) #4

I don’t know which version of bbPress that script is for. @sam worked on it.

(Sam Saffron) #5

Not sure as well :slight_smile: whatever the crazy dump I got was

(Erlend Sogge Heggen) #6

Here’s a new avatar for ya’ll:

(Erlend Sogge Heggen) #7

Should update the top post with the new Vanilla import :cake:

The bbPress importer appears to be for bbPress 2 btw, i.e. the bbPress Plugin. It’d be nice if you could mention what version(s) you’ve tested with though.

(Rahul Bansal) #8

First, thanks for scripts. :smile:

Can we connect to production database on different server?

I tried and keep getting error…

I ran: ruby script/import_scripts/bbpress.rb

I got following error:

/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- mysql2 (LoadError)
	from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from script/import_scripts/bbpress.rb:9:in `<main>'

I added gem 'mysql2' to Gemfile and ran bundle install and run command ruby script/import_scripts/bbpress.rb again

/usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:898:in `rescue in connect': FATAL:  database "discourse_development" does not exist (ActiveRecord::NoDatabaseError)
Run `$ bin/rake db:create db:migrate` to create your database
	from /usr/local/lib/ruby/gems/2.0.0/gems/activerecord-4.

Then I tried: bundle exec ruby script/import_scripts/bbpress.rb which also gave me same error message as above.

I am relatively new to rails app. Is it happening because our discourse setup is using postgres? Where discourse_development database is looked upon? In local postgres or remote mysql database?

Please help/guide.

(Arpit Jalan) split this topic #9

I moved 14 posts to a new topic: Issues while migrating from bbpress

(Arpit Jalan) split this topic #23

I moved 10 posts to a new topic: Issues while migrating from Kunena

(Erlend Sogge Heggen) #24

It’s quite a bit more than that now :wink: I would like to make 2 suggestions:

  1. Tag every forum import how-to on Meta with “import” so that they can be linked to as such. (or give them a unique tag and link to that)
  2. Rewrite the above paragraph to something like this:

Discourse currently provides import scripts for a wide range of forum software, including the most popular ones like Vanilla, phpBB3, SMF2, bbPress and VBulletin.

Issues while migrating from Kunena
(Jeff Atwood) #25

Sure @techapj can you take the above?

(Kane York) #26

I took many of the edits to the post @erlend_sh, just need the tagging I think?

(Erlend Sogge Heggen) #27

Goodygood. Seems we’re opting for the “import tag + search” method, so I went ahead and tagged the relevant topics.

(Wasim Khamlichi) #28

Thanks for this. I have finally managed to get the Kunena import script working after a lot of trial and error (not a ruby developer).

I now have a workable database in a Vagrant machine in the discourse_development db. I’ve exported it and imported it into a production discourse setup but now I’m seeing 500 Internal Server Error on the production site.

Are the databases exactly the same or is there something special I need to do when importing a development database into production?

(Tarek Loubani) #29

I assume this has been sorted out by now, but just FYI, the conversion process isn’t a direct DB copy. Instead, you have to do a backup / restore as per these instructions.

(Philip Colmer) #31

This link isn’t returning any results except for this article.

(Viktor Benei) #32

The correct search filter right now seems to be: tag:import category:56 - category was changed from #howto to #howto:devs

(Arpit Jalan) #33

Thanks @viktorbenei, that’s correct. I edited the first post to reflect the same and made it wiki.