I wrote a better guide to this App on my website, maybe read it instead? It's more colourful.
Satisfy your inner risk manager by taking automated backups from Sanity directly to your S3 bucket!
- Clone this repo
- Add these required config vars from an appropriately configured AWS IAM user to an
- Add another config var from a
readtoken for your Sanity project.
This one is a bit tricker. You'll need a Token for each project you plan to backup. So if your Sanity Project ID is
asdf123, you'd need an Environment Variable called
- Optionally, if you want an email notification with a download link, I've integrated Mailgun, which will need these keys in
You'll need to have Mailgun setup to take advantage of this.
MAILGUN_API MAILGUN_DOMAIN MAILGUN_HOST
- Run a Sanity Export function based on the params you pass in
- Upload that file to S3
- If an email is supplied, send a notification to that address with a link to download
- Host this somewhere adequately if you want to run it in an automated fashion from the cloud. I've tested it working on a ~80mb backup on Heroku. Seems fine.
- Be entirely cool with how average the code is.
Buyer beware. YMMV. Enjoy!