URL Processing Error in migrate_to_s3 Script When Images Are Already Present on S3

Issue

If images are uploaded between enable_s3_uploads being configured and enabled and the rake uploads:migrate_to_s3 task being run, the URLs of the aforementioned images (i.e., those that were uploaded in the space between the configuration change and the rake task being run) will be incorrectly processed.

Steps to Replicate

  1. Configure and enable enable_s3_uploads.
  2. Upload an image somewhere on the forum.
  3. Run rake uploads:migrate_to_s3.

The image uploaded in step 2 will not load properly due to having an incorrect URL.

Proposed Solution

Perhaps the migrate_to_s3 script should check for images that are already present on S3.

(Granted, this is very clearly a type of ‘user error’ as the forum should probably be locked when migrating.)

1 Like

The uploads:migrate_to_s3 rake task has been re-worked and is now much much faster and works properly with images already on S3.

You should try it if you still need it :wink:

3 Likes

This topic was automatically closed after 30 hours. New replies are no longer allowed.