Migrating uploaded files from DO to S3

I was thinking to migrate all the files already uploaded to my discourse site to S3 and then continue serving them from S3 instead of Digital Ocean local disk.

(I already managed to set-up the backups to be stored on another S3 bucket.)

What is the correct procedure to set-up S3 for file uploads? If I just add the s3 upload bucket name and s3 cdn url names, enable Place uploads on Amazon S3 storage, and discourse will take care of the migration, or is there something else I need to do? Do I need to worry about the s3 endpoint?

Thank you!

3 Likes

You don’t have to worry about s3 endpoint if you’re using aws S3 it is only relevant if you’re using something s3 compatible (e.g. DO Spaces)

To migrate existing uploads to S3 bucket you have to run a rake task
rake uploads:migrate_to_s3
And this task requires you to set the S3 parameters through ENV variables.

Follow this guide:

7 Likes

Thank you for your kind help!

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.