# Migrating vBulletin 5 database - Import attachments errors about attachment extension

**URL:** <https://meta.discourse.org/t/migrating-vbulletin-5-database-import-attachments-errors-about-attachment-extension/315235>\
**Category:** Migration\
**Tags:** vbulletin5\
**Created:** [July 6, 2024, 1:53pm UTC](https://meta.discourse.org/t/migrating-vbulletin-5-database-import-attachments-errors-about-attachment-extension/315235 "2024-07-06T13:53:34Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [July 7, 2024, 10:29pm UTC](https://meta.discourse.org/t/migrating-vbulletin-5-database-import-attachments-errors-about-attachment-extension/315235/8 "2024-07-07T22:29:43Z")

</div>

> [@pfaffman](#):
>
> that a problem with newline encoding makes the data in the binary files wrong

Almost - not newline encoding, but treated as text, and therefore corrupted.

`EF BF BD` is the UTF-8 byte sequence for ‘REPLACEMENT CHARACTER’ (U+FFFD). This is indicative of a file being treated as text instead of binary.

A JPEG image starts with `ff d8 ff e0 xx xx 4a 46 49 46 00`

You can see that the first four bytes have each been replaced with `EF BF BD`.

So your images are indeed corrupted. This is not a problem with the importer, this is a problem with the database, as @pfaffman already said. If you have copied this database from another server, you might want to check if this is already an issue in the original database. This could also only be happening on the oldest images (if this happened a long time ago). Just remove the `exit` [line](https://github.com/discourse/discourse/blob/main/script/import_scripts/vbulletin5.rb#L446) and see what happens.

---

_[View the full topic](https://meta.discourse.org/t/migrating-vbulletin-5-database-import-attachments-errors-about-attachment-extension/315235)._
