FIX: include folder name in prefix for listing files on S3 (follow-up on 3ec38f5a)

FIX: include folder name in prefix for listing files on S3 (follow-up on 3ec38f5a)

Fix the destination url in remap since it’s already a part of s3_base_url

diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake
index 1063327..c7b72e2 100644
--- a/lib/tasks/uploads.rake
+++ b/lib/tasks/uploads.rake
@@ -275,7 +275,7 @@ def migrate_to_s3
 
   s3_objects = []
   prefix = Rails.configuration.multisite ? "#{db}/original/" : "original/"
-  options = { bucket: bucket, prefix: prefix }
+  options = { bucket: bucket, prefix: prefix + folder }
 
   loop do
     response = s3.list_objects_v2(options)
@@ -347,7 +347,7 @@ def migrate_to_s3
     }
 
     from = "/uploads/#{db}/original/(\\dX/(?:[a-f0-9]/)*[a-f0-9]{40}[a-z0-9\\.]*)"
-    to = "#{SiteSetting.Upload.s3_base_url}/#{folder}#{prefix}\\1"
+    to = "#{SiteSetting.Upload.s3_base_url}/#{prefix}\\1"
 
     if dry_run
       puts "REPLACING '#{from}' WITH '#{to}'"

GitHub sha: 10fbb07e

FIX: prefix should precede folder path (follow-up on 10fbb07e)

Is this also a fix for this error? @rishabhnambiar