When I created my bucket 2 years ago, I didn’t think about giving it a name good for a CNAME entry, and now I need that feature.
Some files I can move, but others I would rather copy, because I don’t want to break third party links that point to the “old” bucket name.
My requirements are:
- Copy files whose name matches a certain pattern from bucket A to B
- Move files whose name matches a certain pattern from bucket A to B
- Minimize time
- Minimize cost
I’m interested to know estimates of the time, because my website would need to be offline during the move (because I don’t want new files to be added to bucket A resulting in them being lost.)
I’d also like to know what’s the best way to perform this copy/move according to the file names.
There is the COPY commands available in the S3 API. For the move operation, you can first copy the file and then DELETE it.
However I would first try this approach on smaller files. The documentation says:
If this results in a download and upload of the file, this will be quite time-consuming.