This set of rake tasks imports users, threads, and posts from a bbPress instance into Discourse.
- Post dates and authors are preserved
- User accounts are created from bbPress, but have no login capabilities. The emails addresses are set, and gravatars work, but users will need to log in to activate their accounts.
- There is a
test
mode to test the connection to the mysql server and read posts
Use at your own risk! Seriously, test this on a dummy Discourse installation first.
- Important: disable your email configuration or ou will spam all
your users with hundreds of emails. To do this, add this to your
environemnt config (e.g.
config/environments/development.rb
):
config.action_mailer.delivery_method = :test
config.action_mailer.smtp_settings = { address: "localhost", port: 1025 }
Install and start mailcatcher
to monitor the sending of notification
emails:
$ gem install mailcatcher
$ mailcatcher --http-ip 0.0.0.0
-
Be sure to have at least one user in your Discourse instance. If not, create one and set the username in
config/import_bbpress.yml
. -
Edit
config/import_bbpress.yml
with your database connection information anddiscourse_admin
username. -
Install the
mysql2
gem:
$ bundle install
Note: You may need to install the header files for mysql. For OS X,
you can do this with brew install mysql
; for Debian, sudo apt-get install libmysqlclient-dev
; on CentOS/RHEL, sudo yum install mysql-devel
.
- Copy
config/import_bbpress.yml
to yourdiscourse/config
directory - Copy
lib/tasks/import_bbpress.rake
to yourdiscourse/lib/tasks/
directory - In your discourse instance, run
rake import:bbpress
Note: if you are running multisite, you will need pass your database
instance: export RAILS_DB=<your_database> rake import:bbpress
- Cross your fingers
- If everything worked, deploy
- Be sure to have your users reset their passwords on the new Discourse site.
Please make all pull requests to the develop branch. And example process for making a pull request:
- Fork and clone the repo
$ git checkout -b feature-my-awesome-improvement
- Make changes and commit
- Push changes to Github
- Create a pull request from
feature-my-awesome-improvement
on your repo todevelop
on the main repo - Celebrate your contribution to Open Source!!