# 从mybb迁移

**URL:** https://meta.discourse.org/t/migrating-from-mybb/25563
**Category:** Support
**Created:** [2015年二月23日 11:12 UTC](https://meta.discourse.org/t/migrating-from-mybb/25563 "2015-02-23T11:12:46Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [2015年三月14日 02:02 UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/5 "2015-03-14T02:02:37Z")

</div>

@elberet, thanks for your help so far. I went for the second option - connecting from the Discourse machine to the MySQL server of the running forum (set to maintenance mode) after enabling port 3306 in the firewall and setting `bind-address = 0.0.0.0` in `/etc/mysql/my.cnf` followed by a `sudo service mysql restart`. Here’s what I’ve done based on your advice:

```sh
cd /var/discourse
./launcher enter app
apt-get update
apt-get install libmysqlclient-dev mc -y
gem install mysql2 # mysql2-0.3.18 got installed
su - discourse
cd /var/www/discourse/script/import_scripts
bundle install
mcedit mybb.rb # make edits to the MySQL connection details
RAILS_ENV=production ruby mybb.rb # no idea what "bundle exec" does

```

To setup redirects from the old forum thread URLs to Discourse topics, see my other post:

[https://meta.discourse.org/t/redirecting-old-forum-urls-to-new-discourse-urls/20930/21?u=dandv](https://meta.discourse.org/t/redirecting-old-forum-urls-to-new-discourse-urls/20930/21)

---

_[View the full topic](https://meta.discourse.org/t/migrating-from-mybb/25563)._
