# Why vbulletin 4 importer exclude the firstpost?

**URL:** https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196
**Category:** Development
**Created:** [November 21, 2016, 2:25pm UTC](https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196 "2016-11-21T14:25:40Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![enigmaty](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/enigmaty/32/65626_2.png) [@enigmaty](https://meta.discourse.org/u/enigmaty)
#### Post date: [November 21, 2016, 2:25pm UTC](https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196/1 "2016-11-21T14:25:40Z")

</div>

Why the importer in vbulletin exclude the firstpost from the `total_count`?

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

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [November 21, 2016, 3:03pm UTC](https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196/2 "2016-11-21T15:03:10Z")

</div>

Most likely because the first post is used to create the topic.

---

<div class="post-metadata">

### Author: ![enigmaty](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/enigmaty/32/65626_2.png) [@enigmaty](https://meta.discourse.org/u/enigmaty)
#### Post date: [November 21, 2016, 3:14pm UTC](https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196/3 "2016-11-21T15:14:04Z")

</div>

But then if I have ten topic/thread with attachment just in the first post, the `total_count` will be zero, even though I have ten attachments. right?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [November 21, 2016, 3:19pm UTC](https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196/4 "2016-11-21T15:19:48Z")

</div>

Hmm, I didn’t look closely enough. Looks like you’re right 😉

PRs are welcome 😄

---

<div class="post-metadata">

### Author: ![enigmaty](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/enigmaty/32/65626_2.png) [@enigmaty](https://meta.discourse.org/u/enigmaty)
#### Post date: [November 21, 2016, 3:26pm UTC](https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196/5 "2016-11-21T15:26:28Z")

</div>

> [@zogstrip](#):
>
> PRs are welcome

Ok.

While we at it, this line cause errors:

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

I had to modified it just like the vb5 importer:

> <https://github.com/discourse/discourse/blob/main/script/import_scripts/vbulletin5.rb#L272>

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [November 21, 2016, 4:22pm UTC](https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196/6 "2016-11-21T16:22:48Z")

</div>

What was the error? Did it try creating an already existing index?

---

<div class="post-metadata">

### Author: ![enigmaty](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/enigmaty/32/65626_2.png) [@enigmaty](https://meta.discourse.org/u/enigmaty)
#### Post date: [November 21, 2016, 4:25pm UTC](https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196/7 "2016-11-21T16:25:18Z")

</div>

> [@zogstrip](#):
>
> Did it try creating an already existing index?

Yes I did. I get the error after the second run.

ref:  
[https://meta.discourse.org/t/vbulletin-importer-fails/26120](https://meta.discourse.org/t/vbulletin-importer-fails/26120)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [November 21, 2016, 4:26pm UTC](https://meta.discourse.org/t/why-vbulletin-4-importer-exclude-the-firstpost/53196/8 "2016-11-21T16:26:05Z")

</div>

Probably want to handle that better rather than just catching the exception 😉
