# Some questions on vbulletin import script (groups, likes, attachments)

**URL:** https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990
**Category:** Support
**Created:** [15 Gennaio 2016, 8:17am UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990 "2016-01-15T08:17:08Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![lrossouw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lrossouw/32/121275_2.png) [@lrossouw](https://meta.discourse.org/u/lrossouw)
#### Post date: [15 Gennaio 2016, 8:17am UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/1 "2016-01-15T08:17:08Z")

</div>

I’m importing a community forum from vbulletin. And I can’t wait to get it done, because I want to start using discourse pronto.

I’ve managed to get the script running and it can import: users, groups, categories, topics (i.e. first posts) and then failed. Because I gave it only read access to my vb db (to be safe). The backup / restore feature is also invaluable in testing this stuff because it’s so easy to go back to an empty forum.

At this stage, before I run it again I have some questions on this:

- How should I do the user ↔ group mappings? I see it takes the primary group in some way but I don’t see this on the imported forum anywhere. Plus other groups? I guess I’d be able to do the SQL from the mysql side, but how do I add the groups on discourse from the script? Thinking about it the easiest would be to do it “by hand” after import using bulk add user to group funciton.
- Our forum uses the DragonByte Tech: Advanced Post Thanks / Like plugin. I guess I’d be able to figure out who liked/thanked which post from the MySQL database, but again, how do I import said like to discourse. Probably after posts have been imported I need to loop through all the likes/thanks in my database and like the corresponding post on discourse? (Can’t wait for the dislike button to disappear…).
- I haven’t got to attachments yet, but our forum uses attachments that are stored in the DB it seems. Will this be handled by the script or do I need to make changes?
- I see posts with vb code are not being formatted at present. I need to run something after import I believe?

Thanks!

---

<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: [16 Gennaio 2016, 1:15am UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/2 "2016-01-16T01:15:06Z")

</div>

> [@lrossouw](#):
>
> but again, how do I import said like to discourse. Probably after posts have been imported I need to loop through all the likes/thanks in my database and like the corresponding post on discourse? (Can’t wait for the dislike button to disappear…).

You’ll need to create records in the post\_actions table.

Here’s the columns you need to know:

```plaintext
id serial primary key
post_id integer fkey posts
user_id integer fkey users
post_action_type_id integer ; like = 2
deleted_at timestamp null
created_at timestamp
updated_at timestamp
deleted_by_id integer null, fkey users

```

---

<div class="post-metadata">

### Author: ![lrossouw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lrossouw/32/121275_2.png) [@lrossouw](https://meta.discourse.org/u/lrossouw)
#### Post date: [16 Gennaio 2016, 9:50pm UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/3 "2016-01-16T21:50:41Z")

</div>

> [@lrossouw](#):
>
> I haven’t got to attachments yet, but our forum uses attachments that are stored in the DB it seems. Will this be handled by the script or do I need to make changes?

I figured out a neat way to fix this. On the vb forum go to the attachment and switch storage to file based. It will ask for a folder and export all the attachments to that folder. When it is done, it will ask you to finalise this. At this point if you say no you have a folder with all the attachments but the forum is left untouched with attachments in the db.

---

<div class="post-metadata">

### Author: ![lrossouw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lrossouw/32/121275_2.png) [@lrossouw](https://meta.discourse.org/u/lrossouw)
#### Post date: [18 Gennaio 2016, 10:01am UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/4 "2016-01-18T10:01:20Z")

</div>

I see the following remaining formatting issues on my transferred forum. That is after the post clean-up scripts ran:

**Lists tags aren’t fixed**

```
[LIST]
[*]item 1
[*]item 2
[*]item 3
[/LIST]

```

I guess I should just remove the tags and the brackets round the \* and add a space and it should be formatted right. Any ideas how? I can update the import script regex I guess? Looking for some regex genius help.

**COLOR tags**

```
[COLOR=#212121][FONT=Helvetica Neue]blah blah[/FONT][/COLOR]
[COLOR=#212121][FONT=Helvetica Neue]blah blah[/FONT][/COLOR]

```

This seems to come from posts that were made on the old forum by posting formatted text into them.

I guess best would be to just remove the tags? Again need a regex expert I guess?

Is this a bug because this is BBCode? Should this not be picked up? I didn’t for example need to use backtick to quote the above.

---

<div class="post-metadata">

### Author: ![lrossouw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lrossouw/32/121275_2.png) [@lrossouw](https://meta.discourse.org/u/lrossouw)
#### Post date: [18 Gennaio 2016, 10:45am UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/5 "2016-01-18T10:45:46Z")

</div>

Found a bug & PR on phpBB importer. This seems to also apply to vBulletin also.  
[https://github.com/discourse/discourse/pull/2927](https://github.com/discourse/discourse/pull/2927)

---

<div class="post-metadata">

### Author: ![lrossouw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lrossouw/32/121275_2.png) [@lrossouw](https://meta.discourse.org/u/lrossouw)
#### Post date: [21 Gennaio 2016, 10:41pm UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/6 "2016-01-21T22:41:58Z")

</div>

I´ve updated the post\_action table and imported our old likes. These are shown in queries, but not in the interface.  
How do I refresh the interface?  
Answer: `rake user_actions:rebuild`

---

<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: [22 Gennaio 2016, 1:24am UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/7 "2016-01-22T01:24:15Z")

</div>

Oh right, the importer should have been calling `PostAction.act` I think instead of inserting rows.

My bad!

---

<div class="post-metadata">

### Author: ![lrossouw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lrossouw/32/121275_2.png) [@lrossouw](https://meta.discourse.org/u/lrossouw)
#### Post date: [22 Gennaio 2016, 3:54pm UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/8 "2016-01-22T15:54:34Z")

</div>

Yes I wasn’t going to write the import code. Just did it manually from database to database. Then ran the rake. My ruby is bad.

---

<div class="post-metadata">

### Author: ![Haddoq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haddoq/32/258262_2.png) [@Haddoq](https://meta.discourse.org/u/Haddoq)
#### Post date: [30 Aprile 2022, 9:48am UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/9 "2022-04-30T09:48:54Z")

</div>

Risposta molto tardiva… ma mi trovo nella stessa situazione, potresti spiegare come hai trasferito i “mi piace”?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [8 Giugno 2024, 12:36pm UTC](https://meta.discourse.org/t/some-questions-on-vbulletin-import-script-groups-likes-attachments/37990/10 "2024-06-08T12:36:47Z")

</div>

Questo argomento è stato chiuso automaticamente dopo 3067 giorni. Non sono più consentite nuove risposte.
