Hey, I’m looking into options for migrating my old content that is currently on local storage to S3 bucket. I’ve seen some really old repos about this but I’m wondering if they still work or if there is something else newer with continuous support.
Thank you!
I was using GitHub - laosb/ghos3: A modernized AWS S3 storage adapter for Ghost. until last year. I think it still works with 2 remarks:
- When you serve your images from a different domain, you are not able to get the advantage of autoresizing images with
img_url helper.
- There is an issue that blocks uploading zip files on Ghost import.
@muratcorlu What are you using now?
In Synaps Media, I’m directly writing to local disk and then syncing to an S3 bucket in background.
Interesting approach.
But then you load from the S3 or that is just a backup system?
What is the advantage vs a backup?
Yes, currently it’s like a realtime backup. Because I have large enough SSD disks, it doesn’t make sense to do all the reads and writes from an external storage. That would make image uploads and auto-resizes very slow. If your template uses img_url helper, when you upload an image, Ghost makes many reads/writes for generating required sizes for this image, with the requests coming from clients. If you always read/write from/to S3, regarding to original image size, these requests can take several seconds.
Main advantage of using a storage adapter for me would be to serve images and files from a separate domain. That would be most efficient way of serving static contents. But lack of the img_url helper on templates is a big blocker for this. Because even serving thumbnail images with full-sized images gives a much worse result than the advantage of serving images from a different domain.
@pavelmarin, I’d check whether your Ghost version includes the built-in S3Storage adapter in the current docs. Switching adapters won’t migrate existing files, so I’d copy them with their paths preserved and test old URLs, new uploads and a ZIP import on staging.
For @muratcorlu’s thumbnail concern, I’d check urls.image and how resized requests are handled. A CDN serving directly from S3 needs those variants generated somewhere. [redacted reference to third-party service due to potential spam]
Ghost has a built-in S3 storage adapter now.
I also need to update this. I’m using S3 adapter since built-in S3 adapter and urls.image configuration available. Our own custom CDN proxy serves uploaded images and files, by respecting dynamic img_url parameters.