Migrating uploads (images, videos, files) from a Linux server to AWS S3

Hey there!
I know that this is old, but I am having the same issue where I host the uploaded images in an S3 bucket, and use a PostgreSQL database. URLs in the upload_file table are the absolute URLs, and they contain the bucket URL as a prefix. My issue is that I want to move the images to a new bucket with a different URL. Simply changing the configuration of Strapi will only change the URL for the new uploads (Correct me on this if I am wrong), but won’t change the pre-existing images’ URLs. How do I change the existing images’ URL to be prefixed with the new bucket URL?

My current approach is:

  1. Move the images to a new bucket
  2. Configure Strapi to upload on the new bucket
  3. Use SQL queries to modify the url and formats columns in the upload_file table

Is there any better way to do this?

2 Likes