I have setup my upload bucket originally on AWS, but I want to now use Linode. Setup went well and I can see that images are being uploaded to the Linode already.
However, when I look at the old posts, they are still pointing to AWS. How can I move those images to Linode so that I can remove the bucket on AWS?
Thanks!
Falco
(Falco)
5 فبراير 2021، 12:08ص
2
First sync the buckets using a software that can do it (aws cli, s3cmd, etc) and then do a Replace a string in all posts
إعجابَين (2)
I’ve just run this
rake posts:remap["https://royaleapi-discuss-uploads.s3.dualstack.ap-northeast-1.amazonaws.com/","https://royaleapi-discuss-upload.ap-south-1.linodeobjects.com/"]
but it says 0 posts remapped
Even though I can see that that the URL is correct, e.g. by looking at the image URL here:
Idea for Season 21 : The Archers Time Legendary Arena : Archers Ville New Card : Ice Archer ( Legendary ) ( Info about her down below ) Tower Skin : Archers House Emote ( Pass Royale ) : Archers Happy Emote ( Free ) : Archers Say Good Game...
Reading time: 1 mins 🕑
Likes: 2 ❤
إعجاب واحد (1)
Falco
(Falco)
5 فبراير 2021، 1:05ص
5
Try
rake posts:remap["//royaleapi-discuss-uploads.s3.dualstack.ap-northeast-1.amazonaws.com/","//royaleapi-discuss-upload.ap-south-1.linodeobjects.com/"]
إعجابَين (2)
Tried your suggestion. Also tried
rake posts:remap["royaleapi-discuss-uploads.s3.dualstack.ap-northeast-1.amazonaws.com","royaleapi-discuss-upload.ap-south-1.linodeobjects.com"]
Got the same result:
Remapping
0 posts remapped!
Is there a different command to find all posts that don’t do any replacing to see if the command can actually find valid hits?
Falco
(Falco)
5 فبراير 2021، 1:35م
7
You want to inspect the Upload objects:
cd /var/discourse
./launcher enter app
rails c
Upload.order(Arel.sql('RANDOM()')).limit(10).pluck(:id, :url)
إعجاب واحد (1)
Excellent question and advice. Should be a howto ?
4 إعجابات
system
(system)
تم إغلاقه في
7 مارس 2021، 1:48م
9
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.