How to move a Lightsail S3 bucket to an official AWS S3 bucket as well as CloudFront CDN?

Hello all,
I need some help or idea to achieve this.

Continuing the discussion from Setting up file and image uploads to S3:

Long story short:

  • Initially, I tried to setup my AWS S3 bucket for upload and backup then I got the issue with bucket policy ACLs did not allow to upload my files to S3 bucket.
  • Temporary solution, I setup 2 AWS Lightsail buckets one for upload and one for backup. These two buckets work perfectly with the Cloudfront CDN setup. All working well however I still want to get the main stream done correctly!
  • Final solution, with the post from @RedBear, I finally manage to get the AWS S3 bucket running with the proper S3 Policy set up. Note: I haven’t switched the old Cloudfront to the new Cloudfront CDN yet.

My question before I attempt to do the rake tasks:

rake uploads:migrate_to_s3
rake posts:rebake
  • What is the best and smooth solution to achieve the migration from old S3 bucket with old CloudfrontCDN to the new S3 bucket with the new CloudFront CDN?

Note: At the moment my new S3 uploads bucket is empty.

Thanks so much.
Quang

There is Moving from one S3 bucket to another, which is not very easy.

I think what I would do, if everything is still on the lightsail buckets as you say, is to

  • turn on the hidden SiteSetting.include_s3_uploads_in_backups=true on the site with old buckets
  • set read only
  • make a backup
  • restore that backup to the newly configured system
  • switch DNS to new system

I would keep the old system in place for a bit until you’re sure everything is straight on the new one.

If you have things in multiple buckets on a single instance things get much more complicated. I’ve got a couple of sites that way that I’ve been trying off-and-on to get straight for longer that I care to admit publicly.

2 Likes

Can you post the solution? The @RedBear posts are deleted.