Cannot view attachments after import


I have followed this guide to import from phpBB: Importing from phpBB3

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}{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:

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.


  • Matt

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


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

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

cd /var/discourse
sudo ./launcher enter app
rake uploads:migrate_to_s3
1 Like