# Cannot view attachments after import

**URL:** https://meta.discourse.org/t/cannot-view-attachments-after-import/103094
**Category:** Support
**Created:** [November 29, 2018, 5:37pm UTC](https://meta.discourse.org/t/cannot-view-attachments-after-import/103094 "2018-11-29T17:37:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mattbr](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mattbr](https://meta.discourse.org/u/mattbr)
#### Post date: [November 29, 2018, 5:37pm UTC](https://meta.discourse.org/t/cannot-view-attachments-after-import/103094/1 "2018-11-29T17:37:05Z")

</div>

Hi,

I have followed this guide to import from phpBB: [Migrate a phpBB3 forum to Discourse](https://meta.discourse.org/t/importing-from-phpbb3/30810)

I am now using S3 to store user attachments, and all attachments after an import work. The posts href looks like: `https://{MY_S3_BUCKET}.s3.amazonaws.com/original/2X/8/{HASH}.zip`

However all imported attachments href looks like: `https://{MY_WEBSITE}/uploads/default/original/2X/6/{HASH}.zip`

When I SSH onto the machine I can see this attachment lives:  
`/var/discourse/shared/standalone/uploads/default/original/2X/6/{HASH}.zip` but when I click on the link to download the file from my forums instance it results in a 404 page.

I have checked the permissions and even ran `chmod 777 {HASH}.zip` however it still keeps 404ing when trying to download.

I can resolve this by manually modifying the `href` in these posts to refer to the S3 bucket, however it will lead to a page that says:

```plaintext
We were unable to verify that the link you selected was actually posted to the forum. If you wish to proceed anyway, select the link below.

```

Any ideas on how to resolve this and allow all import attachments to work? They exist both in S3 and on the local machine as well.

Thanks,

- Matt

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [November 29, 2018, 5:47pm UTC](https://meta.discourse.org/t/cannot-view-attachments-after-import/103094/2 "2018-11-29T17:47:24Z")

</div>

You can likely fix this by running the `uploads:migrate_to_s3` rake task.

---

<div class="post-metadata">

### Author: ![mattbr](https://avatars.discourse-cdn.com/v4/letter/m/9de0a6/32.png) [@mattbr](https://meta.discourse.org/u/mattbr)
#### Post date: [November 29, 2018, 5:49pm UTC](https://meta.discourse.org/t/cannot-view-attachments-after-import/103094/3 "2018-11-29T17:49:05Z")

</div>

I’ll try that and report back, thank you!

EDIT: Confirmed that running the following commands resolves this issue:

```plaintext
cd /var/discourse
sudo ./launcher enter app
rake uploads:migrate_to_s3

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [October 2, 2021, 1:06am UTC](https://meta.discourse.org/t/cannot-view-attachments-after-import/103094/4 "2021-10-02T01:06:09Z")

</div>


