0

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 -

  1. 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

  2. Manually move the files on S3 while preserving the same folder structure. This is pretty laborious for hundreds of attachments though.

Thanks!

user2490003
  • 10,706
  • 17
  • 79
  • 155
  • this might help http://stackoverflow.com/questions/5518205/move-files-directly-from-one-s3-account-to-another/7983921#7983921 – maniacalrobot Feb 10 '16 at 19:56
  • Thanks, but that appears to be how to move all files between accounts on the S3 side. I'm keeping the same account, but just want to move files around internally between buckets, which can't really be done in one large copy command – user2490003 Feb 10 '16 at 21:25

0 Answers0