I used the technique described here: How to assign a remote Carrierwave file?
This may not be the best way, but it worked for me. My deleted file just turned out to be the old file name / path.
First, I modified the Carrierwave bootloader to have the new file name style I wanted. Then I wrote a rake task to iterate through the records and update such files:
model.remote_image_url = old_image_url model.save!
This will download the existing file again, setting the name / path based on your updated bootloader (and recreate all versions). I have not yet dealt with the problem of cleaning old files, I'm not sure how this will work if your store_dir is the same (mine has changed too).
Be sure to carefully test a few entries before running around the table, which is easy to make of things. Keep in mind that modifying your store_dir will break all of your searches for existing files.
source share