# phpBB 3 Importer (old)

**URL:** <https://meta.discourse.org/t/phpbb-3-importer-old/17397>\
**Category:** Feature\
**Created:** [July 9, 2014, 6:57pm UTC](https://meta.discourse.org/t/phpbb-3-importer-old/17397 "2014-07-09T18:57:02Z")\
**Posts on this page:** 1\
**Showing post:** 85

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [October 7, 2014, 9:19pm UTC](https://meta.discourse.org/t/phpbb-3-importer-old/17397/85 "2014-10-07T21:19:05Z")

</div>

[I added code to the phpbb3 importer to support attachments](https://github.com/discourse/discourse/commit/cea2fe5ee9e2e89a32377c0af23de60a42a77482).

To use it, you’ll need to edit at least one constant near the top of the script: `ATTACHMENTS_BASE_DIR` and possibly `AUTHORIZED_EXTENSIONS`. In my case, I was given a big tar.gz file with all the attachments, so I extracted them somewhere, set `ATTACHMENTS_BASE_DIR` to that directory, and most of the attachments imported successfully.

Some attachments fail to import because of this error:

`Couldn't find phpbb_attachments record for post.id = 9876, import_id = 9123, real_filename = blahblah.jpg`

In those cases, the phpbb\_attachments table really is missing records for those attachments, so there’s no way to import them. Maybe your phpbb databases won’t have this problem.

> [@elberet](#):
>
> Discourse has a utility function that generates the proper and localized HTML markup for an uploaded file, but this is implemented in JavaScript.

I used a hacky solution to this too… so, there’s room for improvement. 😊

---

_[View the full topic](https://meta.discourse.org/t/phpbb-3-importer-old/17397)._
