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)
February 5, 2021, 12:08am
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 Likes
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 Like
Falco
(Falco)
February 5, 2021, 1:05am
5
Try
rake posts:remap["//royaleapi-discuss-uploads.s3.dualstack.ap-northeast-1.amazonaws.com/","//royaleapi-discuss-upload.ap-south-1.linodeobjects.com/"]
2 Likes
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)
February 5, 2021, 1:35pm
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 Like
merefield
(Robert)
February 5, 2021, 1:48pm
8
Excellent question and advice. Should be a howto ?
4 Likes
system
(system)
Closed
March 7, 2021, 1:48pm
9
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.