I have several paperclip attachments that live in one monolithic S3 bucket named foo
I want to split them up into several smaller, more logical buckets (foo1
, foo2
, etc...) based on some internal criteria.
I know which attachments need to move to which new buckets, and I've created the new buckets on S3 already.
Is there a good way to physically move the paperclip attachment to the new buckets programmatically using a rake task?
I can think of two options -
Loop through all attachments and download them temporarily to the filesytem, then re-upload them to the new bucket. This might be difficult on Heroku since there's no real local filesystem
Manually move the files on S3 while preserving the same folder structure. This is pretty laborious for hundreds of attachments though.
Thanks!