I just switched my instance from local to S3 uploads and I could not for the life of me figure out how to get the S3 migrator to work. In the interest of anyone else who stops by this topic, I will summarize the required steps here.
- Enable S3 Uploads in the admin interface and set all of the required S3 keys and settings so new uploads are sent to S3
- Add the required
DISCOURSE_S3_
env variables to the env section of app.yml
Example:
DISCOURSE_S3_BUCKET: your-bucket-name
DISCOURSE_S3_REGION: your-s3-bucket-region
DISCOURSE_S3_ACCESS_KEY_ID: your-s3-access-key-id
DISCOURSE_S3_SECRET_ACCESS_KEY: your-s3-secret-access-key
- Rebuild your app with
./launcher rebuild app
- Enter the app with
./launcher enter app
- Run
rails uploads:migrate_to_s3
from within the docker container.
I initially tried to run the command using ./launcher run app rails uploads:migrate_to_s3
but it couldn’t find the task.