# Migrating from mybb

**URL:** https://meta.discourse.org/t/migrating-from-mybb/25563
**Category:** Support
**Created:** [23 Febbraio 2015, 11:12am UTC](https://meta.discourse.org/t/migrating-from-mybb/25563 "2015-02-23T11:12:46Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [21 Luglio 2016, 11:49pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/21 "2016-07-21T23:49:59Z")

</div>

Possibly, we add importer features as we have paying business hosted customers to migrate – and we always open source those changes!

---

<div class="post-metadata">

### Author: ![alexrcs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexrcs/32/63724_2.png) [@alexrcs](https://meta.discourse.org/u/alexrcs)
#### Post date: [22 Luglio 2016, 12:46am UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/22 "2016-07-22T00:46:45Z")

</div>

Good to hear that! Thanks, Jeff!

Just asking: any paying businesses migrating from MyBB right now? 😉

---

<div class="post-metadata">

### Author: ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)
#### Post date: [30 Luglio 2017, 6:01pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/23 "2017-07-30T18:01:22Z")

</div>

Is there a guide for that right now?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [30 Luglio 2017, 6:07pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/24 "2017-07-30T18:07:35Z")

</div>

> [@bekircem](#):
>
> Is there a guide for that right now?

It doesn’t look like it. It works like most of them, though, and I recently added code that allows you to configure most everything in environment variables (as well as support permalinks). You’ll need to add the mysql2 gem (and virtually every guide includes how to do that).

---

<div class="post-metadata">

### Author: ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)
#### Post date: [30 Luglio 2017, 6:18pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/25 "2017-07-30T18:18:39Z")

</div>

How i use import script? Our Mybb forum and Discourse is not on the same server. I think I could create Mybb database backup and run import script?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [30 Luglio 2017, 6:24pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/26 "2017-07-30T18:24:42Z")

</div>

The usual method is to install a development environment, copy the database to the development server and run the script.

You might use this howto as an example:

> [@Migrate a vBulletin 4 forum to Discourse](https://meta.discourse.org/t/importing-from-vbulletin-4/54881):
>
> In this tutorial we will learn how to migrate vBulletin forum to discourse platform using [vBulletin importer script](https://github.com/discourse/discourse/blob/master/script/import_scripts/vbulletin.rb). I have tested the script with a big database and the result was very good. The script is well written and maintained. Let’s get started slight_smileWhat data can be imported? Groups Users Banned Users =\> Suspended Users Forums Each parent and child forum =\> Category and Sub-category Topics Sticky Thread =\> Pinned Topic Closed Thread =\> Closed Topic Soft Deleted Thr…

Rather than configuring the script as that example suggests, just run it and it’ll tell you what environment variables to set.

---

<div class="post-metadata">

### Author: ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)
#### Post date: [30 Luglio 2017, 9:15pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/27 "2017-07-30T21:15:21Z")

</div>

I’ve problem in that step (I think its about bundle install):

`RAILS_ENV=production ruby script/import_scripts/mybb.rb`

After that command here is the error:

```
URGENT: FATAL: Peer authentication failed for user "discourse"
 Failed to initialize site default
/usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize': FATAL: Peer authentication failed for user "discourse" (PG::ConnectionBad)
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
        from /usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
        from /usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:87:in `connection'
        from /var/www/discourse/lib/site_settings/db_provider.rb:59:in `table_exists?'
        from /var/www/discourse/lib/site_settings/db_provider.rb:30:in `save'
        from /var/www/discourse/lib/site_setting_extension.rb:321:in `add_override!'
        from /var/www/discourse/lib/site_setting_extension.rb:498:in `block in setup_methods'
        from /var/www/discourse/plugins/discourse-narrative-bot/plugin.rb:45:in `block in activate!'
        from /var/www/discourse/lib/plugin/instance.rb:208:in `block in notify_after_initialize'
        from /var/www/discourse/lib/plugin/instance.rb:206:in `each'
        from /var/www/discourse/lib/plugin/instance.rb:206:in `notify_after_initialize'
        from /var/www/discourse/config/application.rb:209:in `block (2 levels) in <class:Application>'
        from /var/www/discourse/config/application.rb:209:in `each'
        from /var/www/discourse/config/application.rb:209:in `block in <class:Application>'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:44:in `each'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `instance_exec'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `run'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `call'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:54:in `run_initializers'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/application.rb:352:in `initialize!'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `public_send'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `method_missing'
        from /var/www/discourse/config/environment.rb:5:in `<top (required)>'
        from /var/www/discourse/script/import_scripts/base.rb:14:in `require_relative'
        from /var/www/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
        from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from script/import_scripts/mybb.rb:2:in `<main>'
root@discourse-gameofthronestr-app:/var/www/discourse#
root@discourse-gameofthronestr-app:/var/www/discourse#
root@discourse-gameofthronestr-app:/var/www/discourse#
root@discourse-gameofthronestr-app:/var/www/discourse# RAILS_ENV=production ruby script/import_scripts/mybb.rb
URGENT: FATAL: Peer authentication failed for user "discourse"
 Failed to initialize site default
/usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize': FATAL: Peer authentication failed for user "discourse" (PG::ConnectionBad)
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
        from /usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
        from /usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:87:in `connection'
        from /var/www/discourse/lib/site_settings/db_provider.rb:59:in `table_exists?'
        from /var/www/discourse/lib/site_settings/db_provider.rb:30:in `save'
        from /var/www/discourse/lib/site_setting_extension.rb:321:in `add_override!'
        from /var/www/discourse/lib/site_setting_extension.rb:498:in `block in setup_methods'
        from /var/www/discourse/plugins/discourse-narrative-bot/plugin.rb:45:in `block in activate!'
        from /var/www/discourse/lib/plugin/instance.rb:208:in `block in notify_after_initialize'
        from /var/www/discourse/lib/plugin/instance.rb:206:in `each'
        from /var/www/discourse/lib/plugin/instance.rb:206:in `notify_after_initialize'
        from /var/www/discourse/config/application.rb:209:in `block (2 levels) in <class:Application>'
        from /var/www/discourse/config/application.rb:209:in `each'
        from /var/www/discourse/config/application.rb:209:in `block in <class:Application>'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:44:in `each'
        from /usr/local/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `instance_exec'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:30:in `run'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `call'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
        from /usr/local/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/initializable.rb:54:in `run_initializers'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/application.rb:352:in `initialize!'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `public_send'
        from /usr/local/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/railtie.rb:194:in `method_missing'
        from /var/www/discourse/config/environment.rb:5:in `<top (required)>'
        from /var/www/discourse/script/import_scripts/base.rb:14:in `require_relative'
        from /var/www/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
        from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from script/import_scripts/mybb.rb:2:in `<main>'

```

---

<div class="post-metadata">

### Author: ![smaffulli](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/smaffulli/32/120462_2.png) [@smaffulli](https://meta.discourse.org/u/smaffulli)
#### Post date: [31 Luglio 2017, 8:00pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/28 "2017-07-31T20:00:56Z")

</div>

> [@bekircem](#):
>
> URGENT: FATAL: Peer authentication failed for user “discourse”

are you running the import script as `discourse` user? If not, you should `su - discourse` before attempting to run the `rails r` part.

---

<div class="post-metadata">

### Author: ![pitp2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pitp2/32/157922_2.png) [@pitp2](https://meta.discourse.org/u/pitp2)
#### Post date: [6 Gennaio 2019, 2:25pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/29 "2019-01-06T14:25:01Z")

</div>

Hello,

I’m trying to migrate mybdd from myBB to Discourse

I use the commands given by [Dan Dascalescu](https://meta.discourse.org/u/dandv)

But doesn’t work for me ..

I posted the log, could you help me ?

```
root@vps:~# cd /var/discourse
root@vps:/var/discourse# ./launcher enter app
root@-app:/var/www/discourse# apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:4 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease
Hit:5 https://deb.nodesource.com/node_8.x xenial InRelease
Fetched 216 kB in 0s (287 kB/s)
Reading package lists... Done
root@vps-app:/var/www/discourse# apt-get install libmysqlclient-dev mc -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
mc is already the newest version (3:4.8.15-2).
libmysqlclient-dev is already the newest version (5.7.24-0ubuntu0.16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.
root@vps-app:/var/www/discourse# gem install mysql2
Building native extensions. This could take a while...
Successfully installed mysql2-0.5.2
1 gem installed
root@vps-app:/var/www/discourse# su - discourse
discourse@vps-app:~$ cd /var/www/discourse/script/import_scripts
discourse@vps-app:/var/www/discourse/script/import_scripts$ bundle install
Using rake 12.3.2
Using concurrent-ruby 1.1.3
Using i18n 1.1.1
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using builder 3.2.3
Using erubi 1.7.1
Using mini_portile2 2.3.0
Using nokogiri 1.8.5
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.2
Using rack 2.0.6
Using rack-test 1.1.0
Using actionpack 5.2.2
Using globalid 0.4.1
Using activejob 5.2.2
Using mini_mime 1.0.1
Using mail 2.7.1.rc1
Using actionmailer 5.2.2
Using activemodel 5.2.2
Using active_model_serializers 0.8.4
Using arel 9.0.0
Using activerecord 5.2.2
Using public_suffix 3.0.2
Using addressable 2.5.2
Using ast 2.4.0
Using aws-eventstream 1.0.1
Using aws-partitions 1.104.0
Using aws-sigv4 1.0.3
Using jmespath 1.4.0
Using aws-sdk-core 3.27.0
Using aws-sdk-kms 1.9.0
Using aws-sdk-s3 1.19.0
Using ember-source 2.13.3
Using execjs 2.7.0
Using barber 0.12.0
Using msgpack 1.2.4
Using bootsnap 1.3.0
Using bundler 1.17.3
Using byebug 10.0.2
Using certified 1.0.0
Using chunky_png 1.3.10
Using claide 1.0.2
Using colored2 3.1.2
Using cork 0.3.0
Using nap 1.1.0
Using open4 1.3.4
Using claide-plugins 0.9.2
Using coderay 1.1.2
Using connection_pool 2.2.2
Using cppjieba_rb 0.3.0
Using safe_yaml 1.0.4
Using crack 0.4.3
Using multipart-post 2.0.0
Using faraday 0.12.2
Using faraday-http-cache 1.3.1
Using git 1.4.0
Using kramdown 1.17.0
Using no_proxy_fix 0.1.2
Using sawyer 0.8.1
Using octokit 4.9.0
Using unicode-display_width 1.4.0
Using terminal-table 1.8.0
Using danger 5.6.3
Using diff-lcs 1.3
Using exifr 1.3.4
Using fspath 3.1.0
Using image_size 1.5.0
Using in_threads 1.5.0
Using progress 3.4.0
Using discourse_image_optim 0.26.2
Using email_reply_trimmer 0.1.12
Using ember-data-source 3.0.2
Using sprockets 3.7.2
Using ember-handlebars-template 0.7.5
Using method_source 0.8.2
Using thor 0.19.4
Using railties 5.2.2
Using jquery-rails 4.3.3
Using ember-rails 0.18.5
Using excon 0.62.0
Using fabrication 2.20.1
Using fakeweb 1.3.0
Using fast_blank 1.0.0
Using rake-compiler 1.0.4
Using fast_xor 1.1.3
Using fast_xs 0.8.0
Using fastimage 2.1.3
Using ffi 1.9.25
Using flamegraph 0.9.5
Using gc_tracer 1.5.1
Using guess_html_encoding 0.0.11
Using hashdiff 0.3.7
Using hashie 3.5.7
Using highline 1.7.10
Using hiredis 0.6.1
Using hkdf 0.3.0
Using htmlentities 4.3.4
Using http_accept_language 2.0.5
Using jaro_winkler 1.5.1
Using jwt 1.5.6
Using kgio 2.11.2
Using libv8 6.7.288.46.1 (x86_64-linux)
Using rb-fsevent 0.10.3
Using rb-inotify 0.9.10
Using ruby_dep 1.5.0
Using listen 3.1.5
Using request_store 1.4.1
Using lograge 0.10.0
Using logstash-event 1.2.02
Using logstash-logger 0.26.1
Using logster 1.3.4
Using lru_redux 1.1.0
Using maxminddb 0.1.21
Using memory_profiler 0.9.12
Using message_bus 2.2.0.pre.1
Using metaclass 0.0.4
Using mini_racer 0.2.3
Using mini_scheduler 0.8.1
Using mini_sql 0.1.10
Using mini_suffix 0.3.0
Using mocha 1.5.0
Using mock_redis 0.18.0
Using moneta 1.0.0
Using multi_json 1.13.1
Using multi_xml 0.6.0
Using mustache 1.0.5
Using nokogumbo 1.5.0
Using oauth 0.5.4
Using oauth2 1.4.0
Using oj 3.6.2
Using omniauth 1.8.1
Using omniauth-oauth2 1.5.0
Using omniauth-facebook 5.0.0
Using omniauth-github 1.3.0
Using omniauth-google-oauth2 0.5.3
Using omniauth-instagram 1.3.0
Using omniauth-oauth 1.1.0
Using ruby-openid 2.7.0
Using rack-openid 1.3.1
Using omniauth-openid 1.0.1
Using omniauth-twitter 1.4.0
Using sanitize 4.6.5
Using onebox 1.8.71
Using redis 4.0.1
Using openid-redis-store 0.0.2
Using parallel 1.12.1
Using parser 2.5.3.0
Using pg 1.1.3
Using powerpack 0.1.2
Using slop 3.6.0
Using pry 0.10.4
Using pry-nav 0.2.4
Using pry-rails 0.3.6
Using puma 3.11.4
Using r2 0.2.7
Using rack-mini-profiler 1.0.1
Using rack-protection 2.0.3
Using rails_multisite 2.0.4
Using rainbow 3.0.0
Using raindrops 0.19.0
Using trollop 2.1.2
Using rbtrace 0.4.10
Using rchardet 1.8.0
Using redis-namespace 1.6.0
Using rinku 2.0.4
Using rotp 3.3.1
Using rqrcode 0.10.1
Using rspec-support 3.7.1
Using rspec-core 3.7.1
Using rspec-expectations 3.7.0
Using rspec-mocks 3.7.0
Using rspec 3.7.0
Using rspec-html-matchers 0.9.1
Using rspec-rails 3.7.2
Using rtlit 0.0.5
Using ruby-progressbar 1.10.0
Using rubocop 0.60.0
Using ruby-readability 0.7.0
Using sass-listen 4.0.0
Using sass 3.5.6
Using sassc 1.11.4
Using seed-fu 2.3.9
Using shoulda-context 1.2.2
Using shoulda-matchers 2.8.0
Using shoulda 3.5.0
Using sidekiq 5.1.3
Using sprockets-rails 3.2.1
Using sshkey 1.9.0
Using stackprof 0.2.11
Using tilt 2.0.8
Using uglifier 4.1.11
Using unf_ext 0.0.7.5
Using unf 0.1.4
Using unicorn 5.4.0
Using webmock 3.4.2
Using webpush 0.3.2
Bundle complete! 112 Gemfile dependencies, 202 gems now installed.
Gems in the group development were not installed.
Bundled gems are installed into `../../vendor/bundle`
discourse@vps-app:/var/www/discourse/script/import_scripts$ mcedit mybb.rb

discourse@vps-app:/var/www/discourse/script/import_scripts$ RAILS_ENV=production ruby mybb.rb
Traceback (most recent call last):
        23: from mybb.rb:2:in `<main>'
        22: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        21: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        20: from /var/www/discourse/script/import_scripts/base.rb:14:in `<top (required)>'
        19: from /var/www/discourse/script/import_scripts/base.rb:14:in `require_relative'
        18: from /var/www/discourse/config/environment.rb:2:in `<top (required)>'
        17: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        16: from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        15: from /var/www/discourse/config/application.rb:40:in `<top (required)>'
        14: from /var/www/discourse/config/application.rb:41:in `<module:Discourse>'
        13: from /var/www/discourse/config/application.rb:57:in `<class:Application>'
        12: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:246:in `require_dependency'
        11: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:334:in `depend_on'
        10: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:356:in `require_or_load'
         9: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `load_interlock'
         8: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:13:in `loading'
         7: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
         6: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
         5: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
         4: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:373:in `block in require_or_load'
         3: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:475:in `load_file'
         2: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:661:in `new_constants_in'
         1: from /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:476:in `block in load_file'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:476:in `load': No such file to load -- lib/discourse.rb (LoadError)
discourse@vps-app:/var/www/discourse/script/import_scripts$

```

---

<div class="post-metadata">

### Author: ![pitp2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pitp2/32/157922_2.png) [@pitp2](https://meta.discourse.org/u/pitp2)
#### Post date: [10 Gennaio 2019, 10:49am UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/30 "2019-01-10T10:49:40Z")

</div>

Hello,

nobody can help me ?

Regards,

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10 Gennaio 2019, 1:02pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/31 "2019-01-10T13:02:40Z")

</div>

Try running the script from /var/www/discourse and not the script directory?

---

<div class="post-metadata">

### Author: ![pitp2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pitp2/32/157922_2.png) [@pitp2](https://meta.discourse.org/u/pitp2)
#### Post date: [10 Gennaio 2019, 1:29pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/32 "2019-01-10T13:29:02Z")

</div>

Thank you for your reply

so I have to copy past the mybb.ruby to /var/www/discourse before ?

---

<div class="post-metadata">

### Author: ![pitp2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pitp2/32/157922_2.png) [@pitp2](https://meta.discourse.org/u/pitp2)
#### Post date: [10 Gennaio 2019, 1:38pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/33 "2019-01-10T13:38:30Z")

</div>

I copy past mybb.rb in /var/www/discourse

but I have another issue

```
root@vps-app:/var/www/discourse# RAILS_ENV=production bundle exec ruby mybb.rb
Traceback (most recent call last):
        1: from mybb.rb:1:in `<main>'
mybb.rb:1:in `require': cannot load such file -- mysql2 (LoadError)
root@vps-app:/var/www/discourse#

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10 Gennaio 2019, 2:24pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/34 "2019-01-10T14:24:16Z")

</div>

You’ll need to install the gem. There are some #howto posts for other importers that you should use as a model. You should read those. There are dozens more tiny little things you’ll need to figure out.

If you need so by step help and have a budget my context info is in my profile.

---

<div class="post-metadata">

### Author: ![WillyRL](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/willyrl/32/160972_2.png) [@WillyRL](https://meta.discourse.org/u/WillyRL)
#### Post date: [12 Novembre 2019, 4:47pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/35 "2019-11-12T16:47:32Z")

</div>

Ragazzi,

Qualcuno è riuscito a migrare da MyBB a Discourse?

Ho questo errore:

```
discourse@hn-app:/var/www/discourse/script/import_scripts$ RAILS_ENV=production ruby mybb.rb

**Traceback** (most recent call last):

23: from mybb.rb:4:in `<main>'

22: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

21: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

20: from /var/www/discourse/script/import_scripts/base.rb:16:in `<top (required)>'

19: from /var/www/discourse/script/import_scripts/base.rb:16:in `require_relative'

18: from /var/www/discourse/config/environment.rb:4:in `<top (required)>'

17: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

16: from /usr/local/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

15: from /var/www/discourse/config/application.rb:58:in `<top (required)>'

14: from /var/www/discourse/config/application.rb:59:in `<module:Discourse>'

13: from /var/www/discourse/config/application.rb:75:in `<class:Application>'

12: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:280:in `require_dependency'

11: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:368:in `depend_on'

10: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:390:in `require_or_load'

9: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:40:in `load_interlock'

8: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies/interlock.rb:13:in `loading'

7: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'

6: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies/interlock.rb:14:in `block in loading'

5: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:40:in `block in load_interlock'

4: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:407:in `block in require_or_load'

3: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:510:in `load_file'

2: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:702:in `new_constants_in'

1: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:511:in `block in load_file'

/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/dependencies.rb:511:in `load': **No such file to load -- lib/discourse.rb (**  **LoadError** **)**

```

Non ho idea di come risolvere questo problema.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [12 Novembre 2019, 5:01pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/36 "2019-11-12T17:01:37Z")

</div>

Prova `RAILS_ENV=production rails runner mybb.rb`

---

<div class="post-metadata">

### Author: ![WillyRL](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/willyrl/32/160972_2.png) [@WillyRL](https://meta.discourse.org/u/WillyRL)
#### Post date: [12 Novembre 2019, 5:10pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/37 "2019-11-12T17:10:00Z")

</div>

Grazie per la risposta, ma ora ho questo:

`/usr/local/lib/ruby/gems/2.6.0/gems/activerecord-6.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:50:in 'rescue in postgresql_connection': **FATAL: Autenticazione peer fallita per l'utente "discourse" (**  **ActiveRecord::NoDatabaseError** **)**`

Dopo aver eseguito `su` per accedere all’utente discourse, ho ottenuto:

```
Specifica un comando ruby valido o il percorso di uno script da eseguire.

Esegui 'rails runner -h' per ottenere aiuto.

variabile locale o metodo `mybb` non definito per main:Object

```

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [12 Novembre 2019, 5:52pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/38 "2019-11-12T17:52:39Z")

</div>

L’errore è che il tuo Rails non riesce a connettersi al database PostgreSQL. Ti consiglio di indagare sul motivo per cui l’utente `discourse` non può farlo.

---

<div class="post-metadata">

### Author: ![WillyRL](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/willyrl/32/160972_2.png) [@WillyRL](https://meta.discourse.org/u/WillyRL)
#### Post date: [12 Novembre 2019, 6:00pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/39 "2019-11-12T18:00:37Z")

</div>

Ciao,

Penso di aver risolto il problema, sto seguendo questo riferimento

> [@Migrate a XenForo forum to Discourse](https://meta.discourse.org/t/importing-xenforo-to-discourse/45232):
>
> Hey guys so after trying for a week or so I decided to import the database on docker app which I hoped it will succeed without any issues. TBH I got some issues at first but it turned to be all easy to solve. Now I would recommend doing this only once before you deploy your production site, after importing everything take a Discourse backup, wipe everything out and install new Discourse instance then restore the imported db. Ok let’s begin: First lets backup your old database from your old …

modificando questo file

1. Modifica il file `/etc/postgresql/9.5/main/pg_hba.conf`

\*\*AGGIORNAMENTO: Funziona, grazie mille \*\*

---

<div class="post-metadata">

### Author: ![WillyRL](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/willyrl/32/160972_2.png) [@WillyRL](https://meta.discourse.org/u/WillyRL)
#### Post date: [12 Novembre 2019, 6:09pm UTC](https://meta.discourse.org/t/migrating-from-mybb/25563/40 "2019-11-12T18:09:44Z")

</div>

Scusa @eviltrout, devo chiedere altro: come possiamo mantenere in esecuzione la migrazione mentre la stiamo chiudendo? Ho dimenticato di eseguirla con screen; posso annullarla e riavviarla?

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/6/f664f920f6af3a40c1d733ba0db54d8dd9d8fbcb.png)

[Pagina precedente](https://meta.discourse.org/t/migrating-from-mybb/25563.md?page=1)

[Pagina seguente](https://meta.discourse.org/t/migrating-from-mybb/25563.md?page=3)
