Migrating storage from S3 to local

Hello,

My current installation of ghost is using S3 content adapter and storage. I’m thinking about moving back to local storage. I thought it would be just be configuration change but it appears S3 URL is written inside the code of each post.

Is there a way to simply move back to local storage ?

If I do a database json export, remove all the S3 URL, and import back the data, would it work?

Thanks
Steven

1 Like

Do you mind sharing a bit as to why you decided to transition back to local from S3?

Sure.

We are talking of a personal blog and simple installation without a lot of users.

  • After 1 year of usage, I am more aware of how much space I need and I know that local hard disk is enough
  • I can benefit out of the box from image resizing features
  • For ethical reason, I would like to get rid of amazon services

Another scenario would be to change the s3 provider (and use a local s3 with minio for example) but I guess I will face the same difficulties. This could happen to bigger customers.

I moved by images from S3 back to local hosting around a month ago I was in a similar situation.
What I did was

  1. Used Cyberduck to download all the images from the s3 bucket.
  2. Upload all the images to /var/www/{ghostFolder}/content/images/
  3. Exported content from Ghost Admin (Ghost Settings → Labs → Migration Options)
  4. Made a back up of the file.
  5. Edit 1 of the files, done a search for cdn.mydomain.com/ and replaced it with mydomain.com/content/images/ and save. You may have to play about with these 2 values depending on how you saved to your s3 bucked.
  6. Back in Ghost Admin, delete all content, and then import content.
1 Like