I have a rails application that is using attachment_fu. Currently, it is using :file_system
for storage, but I want to change it to :s3
, to allow for better scaling as more files get uploaded.
What is involved with this? I imagine that if I just switch the code to use :s3
, all the old links will be broken. Do I need to just copy the existing files from the file system to S3? A google search hasn't turned up much on the topic.
I would prefer to move the existing files over to S3, so everything is in the same place, but if necessary, the old files can stay where they are, as long as new ones go to S3.
EDIT: So, it is not as simple as copying over the files to S3; the URLs are created using a different scheme. When they are stored in :file_system
, the files end up in places like /public/photos/0000/0001/file.name, but the same file in :s3
might end up in 0/1/file.name. I think it is using the id something, and just padding it (or not) with zeros, but I'm not sure of that.