Migrating images to new url/path format

47 views
Skip to first unread message

zubin

unread,
Jan 15, 2012, 8:34:43 PM1/15/12
to Paperclip Plugin
Is there a recommended technique for migrating a large set of images
to a new :url and :path format?

The reason I'm doing this is because after upgrading to rails 3.1
cached versions of thumbs are being shown after cropping. This is
because the filename no longer changes (since asset_timestamp is no
longer used in rails 3.1). I'm using :fingerprint in the url/path
format, but this is generated from the original, which doesn't change
when cropping.

I was intending to insert :updated_at in the url/path format, and
update attachment.updated_at during cropping, but after implementing
that change all existing images would need to be moved to their new
location. There's over 100k images (with 3 styles each) to rename over
S3.

At this point I'm considering copying them to their new location
first, then deploying the code change, then moving any images which
were missed (ie uploaded after the copy), but I'm hoping there's an
easier way... any suggestions?
Reply all
Reply to author
Forward
0 new messages