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. Februar 2021 um 00: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 „Gefällt mir“
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 „Gefällt mir“
Falco
(Falco)
5. Februar 2021 um 01: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 „Gefällt mir“
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. Februar 2021 um 13: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 „Gefällt mir“
merefield
(Robert)
5. Februar 2021 um 13:48
8
Excellent question and advice. Should be a howto ?
4 „Gefällt mir“
system
(system)
Geschlossen,
7. März 2021 um 13:48
9
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.