Hello. We just migrated from Discourse EC2 to Discourse ECS (container service). When we were in EC2, S3 Uploads was not set up yet. Before the migration, we copied all images from EC2 to the S3 bucket (with public access). However, after doing the migration with S3 Uploads enabled (no CDN yet), we noticed that images (and avatars) didn’t load at all.
Just to ask, should this be ran in EC2 only? Is there another way to migrate uploads or update image URLs? Currently, the EC2 instance is stopped and the current ECS setup uses the domain and database/cache already so I’m not sure if we can point the domain and database/cache back to the old EC2 (then rebuild) without downtime. Thank you.
You’l want to run the command in an instance that has access to the images. Oh, but if you moved them to S3 yourself by hand, then you might want to do some surgery on the uploads table instead.
I have been working on a howto with instructions for moving from one bucket to another that you might use to solve your problem, though you’ll need to modify those instructions to account for your local-to-bucket rather than bucket-to-bucket changes.
If I were to bill you a flat rate for the job, I’d probably charge 4 hours, though if you were to pay by the hour it might be only one.
Oh! Sorry. I just noticed this. If the EC2 is using the same database, then you might be able to crank it back up (leaving the ECS in place), and run the migrate-to-s3 task there; you’ll need to first put all the S3 stuff in ENV variables as described in Using Object Storage for Uploads (S3 & Clones). This is likely the easiest solution. I’d recommend doing a database-only backup before starting.