# How to convert vBulletin 4 database to Discourse?

**URL:** https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029
**Category:** Support
**Created:** [12.Сентябрь.2016 19:45:32 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029 "2016-09-12T19:45:32Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Matheeus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matheeus/32/121527_2.png) [@Matheeus](https://meta.discourse.org/u/Matheeus)
#### Post date: [12.Сентябрь.2016 19:45:32 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/1 "2016-09-12T19:45:32Z")

</div>

Hi,

I’ve a big board with a database of over 8GB size with vBulletin 4 and I’m evaluating to switch my forum to Discourse.

So, I’m trying to convert my vB4 db to Discourse: how to do this? I’ve noticed the script at this link [discourse/script/import\_scripts/vbulletin.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/script/import_scripts/vbulletin.rb) but I don’t know how to execute it and what it needs.

Is there any guide about vB4-\>Discourse conversion?

(Actually, i’ve any experience with Ruby and Docker).

---

<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: [13.Сентябрь.2016 00:08:01 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/2 "2016-09-13T00:08:01Z")

</div>

If you look in #howto there are a few guides on importing existing forums, I am not sure if vBulletin is specifically there, is it @erlend_sh?

---

<div class="post-metadata">

### Author: ![Matheeus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matheeus/32/121527_2.png) [@Matheeus](https://meta.discourse.org/u/Matheeus)
#### Post date: [13.Сентябрь.2016 11:21:16 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/3 "2016-09-13T11:21:16Z")

</div>

Seems that there isn’t any guide about vBulletin import script.

I’m giving a look to phpBB and Xenforo guides, is the procedure similar for vB4?

Actually I only tried to do the following steps:

- Edited the import ruby script in /script/import\_scripts/vbulletin.rb saved in the Docker container with the MySQL user and database information.

- Entered the container bash by “docker exec -it app bash” command

- Give the following command: “bundle exec ruby script/import\_scripts/vbulletin.rb”

After giving this command, I get these errors:  
“script/import\_scripts/vbulletin.rb:404: syntax error, unexpected keyword\_else, expecting keyword\_end  
script/import\_scripts/vbulletin.rb:754: syntax error, unexpected keyword\_end, expecting end-of-input”

What I’m doing wrong?  
_Please don’t limitate to recommend me to buy any export service, actually I can’t afford it and I’m trying to learn (and I need to test first and after decide if switch or not to Discourse, so I can’t waste my money): this is an open suorce software and community, but seems that you’re purposely making the importing question so complicate to make some money. Every topic I read about this question only I see offers to buy some expensive service to get the database converted._

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [13.Сентябрь.2016 13:36:13 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/4 "2016-09-13T13:36:13Z")

</div>

> [@Matheeus](#):
>
> Please don’t limitate to recommend me to buy any export service, actually I can’t afford it and I’m trying to learn (and I need to test first and after decide if switch or not to Discourse, so I can’t waste my money): this is an open suorce software and community, but seems that you’re purposely making the importing question so complicate to make some money. Every topic I read about this question only I see offers to buy some expensive service to get the database converted.

Many forum owners are happy to pay a few hundred bucks to a freelancer from the community to have their forum migrated. I understand that this is not an option for everyone and that’s perfectly ok. We’re not trying to impose limitations on you; we’re merely giving you _options_. As for the lack of tutorials, we’re actively sponsoring technical writers to write tutorials for our open source migration scripts, so please don’t imply that we’re purposely complicating our import pipeline.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [13.Сентябрь.2016 16:07:17 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/5 "2016-09-13T16:07:17Z")

</div>

There does look to be an extra `end` or a missing conditional in this area of the code.

> <https://github.com/discourse/discourse/blob/main/script/import_scripts/vbulletin.rb#L392-L406>

---

<div class="post-metadata">

### Author: ![Matheeus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matheeus/32/121527_2.png) [@Matheeus](https://meta.discourse.org/u/Matheeus)
#### Post date: [13.Сентябрь.2016 18:09:32 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/6 "2016-09-13T18:09:32Z")

</div>

> [@erlend\_sh](#):
>
> > [@Matheeus](#):
> >
> > Please don’t limitate to recommend me to buy any export service, actually I can’t afford it and I’m trying to learn (and I need to test first and after decide if switch or not to Discourse, so I can’t waste my money): this is an open suorce software and community, but seems that you’re purposely making the importing question so complicate to make some money. Every topic I read about this question only I see offers to buy some expensive service to get the database converted.
> 
> Many forum owners are happy to pay a few hundred bucks to a freelancer from the community to have their forum migrated. I understand that this is not an option for everyone and that’s perfectly ok. We’re not trying to impose limitations on you; we’re merely giving you _options_. As for the lack of tutorials, we’re actively sponsoring technical writers to write tutorials for our open source migration scripts, so please don’t imply that we’re purposely complicating our import pipeline.

I really hope so, because it is so **strange** that there’s guide for minor boards like XenForo and bbPress and not for **largely adopted major forum software like vBulletin and Invision.**

Anyway, I think that you should invest seriously more time and attention on the database convert/importing question because **it is something of crucial for many forums that want to switch to Discourse** and not all can spend hundreds bucks only to get a script, _with severe lack of documentation (this could make troubles also to an experienced dev)_, to work.

---

<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: [13.Сентябрь.2016 18:42:59 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/7 "2016-09-13T18:42:59Z")

</div>

It should be similar to the [Kunena3](https://meta.discourse.org/t/importing-from-kunena-3/43776) import. You’re probably better off installing a Development environment than trying to it in a container.

> [@Matheeus](#):
>
> I really hope so, because it is so strange that there’s guide for minor boards like XenForo and bbPress and not for largely adopted major forum software like vBulletin and Invision.

The importers that get developed are the ones that Discourse’s customers need.

> [@Matheeus](#):
>
> Anyway, I think that you should invest seriously more time and attention on the database convert/importing question because it is something of crucial for many forums that want to switch to Discourse and not all can spend hundreds bucks only to get a script, with severe lack of documentation (this could make troubles also to an experienced dev), to work.

You get the script for free. For $100-200 bucks you could get someone to import your data for you and give you a backup file that you could restore on your server. It’s likely that there’s something funky with your database, or the script doesn’t import everything you want, though. (I don’t know about the vBulletin script, but the Kunena3 script doesn’t deal with attachments, for example.) When I do an import, I clean up the script a bit, and if when I get time, I submit those improvements back to the community. (And Real Soon Now, I’ll submit code for providing links to attachments in Kunena3. Sometime later, someone will fix it so that those attachments get squirted into Discourse rather than linked to where Kunena is storing them.)

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [13.Сентябрь.2016 19:56:54 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/8 "2016-09-13T19:56:54Z")

</div>

> [@Matheeus](#):
>
> Anyway, I think that you should invest seriously more time and attention on the database convert/importing question because it is something of crucial for many forums that want to switch to Discourse and not all can spend hundreds bucks only to get a script, with severe lack of documentation (this could make troubles also to an experienced dev), to work.

I think there’s something going on that you haven’t realized: the team doesn’t consider “migrating to Discourse” a top priority that needs to be as easy as possible. They _do_ consider “start a new Discourse forum” to be a top priority, and “making Discourse awesome once it’s set up” to be a top priority.

So it doesn’t really bother them that the import scripts are unmaintained or hard to use… “we’ll just fix it when we need to use it again”.

---

<div class="post-metadata">

### Author: ![Matheeus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matheeus/32/121527_2.png) [@Matheeus](https://meta.discourse.org/u/Matheeus)
#### Post date: [13.Сентябрь.2016 20:21:14 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/9 "2016-09-13T20:21:14Z")

</div>

> [@riking](#):
>
> > [@Matheeus](#):
> >
> > Anyway, I think that you should invest seriously more time and attention on the database convert/importing question because it is something of crucial for many forums that want to switch to Discourse and not all can spend hundreds bucks only to get a script, with severe lack of documentation (this could make troubles also to an experienced dev), to work.
> 
> I think there’s something going on that you haven’t realized: the team doesn’t consider “migrating to Discourse” a top priority that needs to be as easy as possible. They _do_ consider “start a new Discourse forum” to be a top priority, and “making Discourse awesome once it’s set up” to be a top priority.
> 
> So it doesn’t really bother them that the import scripts are unmaintained or hard to use… “we’ll just fix it when we need to use it again”.

So, **Discourse Team isn’t interested in existing forum to switch to their software**? Unhappy decision at my vision and anyway the problem isn’t that it “needs to be as easy as possible” but that actually those converting scripts are close to be unusable.

We can agree on the fact that mantain a converting script for every existing forum software is likely to be impossible (and time-wasting), but **that’s ridiculous that there isn’t nothing also for the most popular forum boards like vBulletin and IPB.**

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [13.Сентябрь.2016 20:46:33 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/10 "2016-09-13T20:46:33Z")

</div>

If I start to give away free Passion Fruit Ice Cream I’m being ridiculous because I should provide Chocolate and Strawberry flavors, that are more popular?

* * *

The team provides import scripts as Open Source, and [make guides](https://meta.discourse.org/t/migrating-from-ning-to-discourse/49749) whenever they do any new import.

That’s awesome!

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [13.Сентябрь.2016 21:05:06 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/11 "2016-09-13T21:05:06Z")

</div>

Sorry if I’m being a bother here, but is the script broken or am I not reading it correctly?

> [@How to convert vBulletin 4 database to Discourse?](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/5):
>
> There does look to be an extra end or a missing conditional in this area of the code.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [13.Сентябрь.2016 21:10:27 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/12 "2016-09-13T21:10:27Z")

</div>

Looks like it is. The last commit was a big one.

However I don’t have a vBulletin dump to do the testing.

---

<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: [13.Сентябрь.2016 21:11:51 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/13 "2016-09-13T21:11:51Z")

</div>

> [@Falco](#):
>
> Looks like it is. The last commit was a big one.
> 
> However I don’t have a vBulletin dump to do the testing.

That’s what I was going to say. 🙂

If I had a database I could write a HOWTO, and make trivial changes to the script (so that it would run, at least).

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [13.Сентябрь.2016 21:19:51 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/14 "2016-09-13T21:19:51Z")

</div>

Thanks

@Matheeus can you remove or comment out that “end” line (#403) any try to import again?

EDIT

Moot suggestion - this error in the script has been fixed.

---

<div class="post-metadata">

### Author: ![Matheeus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matheeus/32/121527_2.png) [@Matheeus](https://meta.discourse.org/u/Matheeus)
#### Post date: [13.Сентябрь.2016 21:50:40 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/15 "2016-09-13T21:50:40Z")

</div>

> [@pfaffman](#):
>
> > [@Falco](#):
> >
> > Looks like it is. The last commit was a big one.
> > 
> > However I don’t have a vBulletin dump to do the testing.
> 
> That’s what I was going to say. 🙂
> 
> If I had a database I could write a HOWTO, and make trivial changes to the script (so that it would run, at least).

I could do a fresh vB4 install, export the db in sql dump and give it to you if could help.

> [@Mittineague](#):
>
> Thanks
> 
> @Matheeus can you remove or comment out that “end” line (#403) any try to import again?

I try asap.

---

<div class="post-metadata">

### Author: ![Matheeus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matheeus/32/121527_2.png) [@Matheeus](https://meta.discourse.org/u/Matheeus)
#### Post date: [13.Сентябрь.2016 23:37:32 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/16 "2016-09-13T23:37:32Z")

</div>

After reading Kunena3 and XenForo guides, I installed MySQL directly into the Discourse’s Docker container, but I’ve problems into importing the 8GB dump into the mysql database, seems that I don’t have enough space:

```
root@disc3-app:/# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/docker-253:0-519439-486e36cd4557a419fe2143dcf25918218a17d89ab6ee152375945feb4f41554f 10G 10G 20K 100% /
tmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/vg-lv_root 47G 20G 25G 45% /shared
shm 64M 4.0K 64M 1% /dev/shm

```

But my VPS have a disk of 50GB, in fact if i give the same command directly to CentOS I get:

```
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg-lv_root 47G 20G 25G 45% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 25M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 477M 130M 319M 29% /boot
tmpfs 798M 0 798M 0% /run/user/0

```

Seems like Docker creates a “partition” with only 10GB, how can I expand it?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [14.Сентябрь.2016 02:50:30 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/17 "2016-09-14T02:50:30Z")

</div>

> [@Matheeus](#):
>
> After giving this command, I get these errors:  
> “script/import\_scripts/vbulletin.rb:404: syntax error, unexpected keyword\_else, expecting keyword\_end  
> script/import\_scripts/vbulletin.rb:754: syntax error, unexpected keyword\_end, expecting end-of-input”

> [@Mittineague](#):
>
> There does look to be an extra end or a missing conditional in this area of the code.

Yes, there was a missing `if` condition and extra `end`, just fixed via:

[https://github.com/discourse/discourse/commit/92e716a1fd907ee96e9b7ef557e4a71843f49084](https://github.com/discourse/discourse/commit/92e716a1fd907ee96e9b7ef557e4a71843f49084)

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [14.Сентябрь.2016 03:59:13 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/18 "2016-09-14T03:59:13Z")

</div>

Looks like CentOS might run Docker with the devicemapper storage backend, instead of something sane. According to to the `docker-run` manpage, adding something like `--storage-opt size=20G` to the `docker run` command should give you a new container with a larger root filesystem, but quite frankly, I’d send devicemapper to Davy Jones’ locker and use the aufs storage driver instead.

---

<div class="post-metadata">

### Author: ![Matheeus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matheeus/32/121527_2.png) [@Matheeus](https://meta.discourse.org/u/Matheeus)
#### Post date: [14.Сентябрь.2016 10:19:13 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/19 "2016-09-14T10:19:13Z")

</div>

I’ve tryied with this guide: [Increasing the Base Device Size on Docker Daemon Restart — Project Atomic](http://www.projectatomic.io/blog/2016/03/daemon_option_basedevicesize/)

But the only thing I got is to corrupt my Discourse container and also if I recreate it i get some strange errors and so I can’t bootstrap/start the container.

How I can switch to the aufs storage driver?

---

<div class="post-metadata">

### Author: ![Matheeus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matheeus/32/121527_2.png) [@Matheeus](https://meta.discourse.org/u/Matheeus)
#### Post date: [14.Сентябрь.2016 11:49:18 UTC](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029/20 "2016-09-14T11:49:18Z")

</div>

I’m trying your fixed script, but I get this error:

```
root@disc3-app:/# bundle exec ruby /var/www/discourse/script/import_scripts/vbulletin.rb
/var/www/discourse/config/application.rb:2:in `require': cannot load such file -- rails/all (LoadError)
        from /var/www/discourse/config/application.rb:2:in `<top (required)>'
        from /var/www/discourse/config/environment.rb:2:in `require'
        from /var/www/discourse/config/environment.rb:2: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 /var/www/discourse/script/import_scripts/vbulletin.rb:2:in `require'
        from /var/www/discourse/script/import_scripts/vbulletin.rb:2:in `<main>'

```

[Next page](https://meta.discourse.org/t/how-to-convert-vbulletin-4-database-to-discourse/50029.md?page=2)
