ruby-on-railsamazon-web-servicesamazon-s3refinerycmsrefinery

Refinerycms: file names lost after migrating files from one AWS S3 bucket to another


This is how I encountered the problem:

Uploaded files to S3

Tried to download the file, it works ok

Migrated the files in that bucket to another bucket (under the same AWS account)

Tried to download the file again, it works, the file is downloaded, but the name of the file is just "file", no extension.

If I change the file name to add the extension, it still opens. So the content of the file is ok, but the file name is lost after migrating to another bucket.

Has anybody met this problem before? Or know any potential causes of this?

Thanks


Solution

  • I figured this out.

    It is because the metadata was lost during the migration.

    I was moving files from one bucket to another by downloading them to local machine first.

    What I should have done is :

    aws s3 cp s3://b1 s3://b2 --recursive