title: Paperclip + S3: Migrating existing files from one :path format to another
body: <p>I have a model with a <code>avatar</code> paperclip attach. It has now a plain standard path</p>
  
  <pre><code>has_attached_file :avatar,
    :path =&gt; "/:id-:style-:filename"
  </code></pre>
  
  <p>Which I need to move into an obfuscated one</p>
  
  <pre><code>has_attached_file :avatar,
    :path =&gt; "/:id-:hash.:extension"
    :hash_secret =&gt; 'asecuresecret'
  </code></pre>
  
  <p>Everything's working fine with new images, but how do I migrate the existing files stored in S3 to the new path format, ie rename them?</p>
  
  <p>I'm using paperclip 2.7 and Rails 3.2</p>
  
  <p>Thanks !!!</p>