I have a ruby on rails project
I have some few thousand files associated with the site.
Is there a simple way to move all the files from virtual host to cloud (amazon).
Basically I have a lot of images and I am using paperclip gem to store the images.There are already a few users and have thousands of images . Now I have planned to migrate to cloud(amazon). I have used aws-s3 gem for this purpose and it works fine for new images.
But How do I put the old images which were already uploaded ?
Do I have to manually zip and reupload ? or is there a better way ?
Thank you
Hi I would right a simple rake task to accomplish this. It would look like something like this (not tested):
A few notes:
if you are using paperclip to manage and access the files you will want to store them in s3 so paperclip can access them. To do that use
Paperclip::Interpolations.interpolatemethod. like:And this goes without saying — make sure you test this in a staging environment!
Good luck.