Posts tagged: litestream

All posts with the tag "litestream"

3 posts latest post 2025-08-07
Using Litestream to Restore My Database for Easy Development

Using Litestream to Restore My Database for Easy Development

Litestream see Using Litestream to Backup QuadTask's SQLite DB for how I setup litestream replication for QuadTask I have the entrypoint to my app container check if the sqlite database exists or not - in production or with local volume mounts, it will and then we start litestream replication and then the app like normal. But what’s awesome about this little trick I got from this litestream example is I can docker compose up locally without the data directory volume mounted in, and get a fresh copy of my production data right there locally to work with! My entrypoint script now looks like: Appropriate and Safe Replication # The way to get prod data in automatically is to restore from the production backup but I don’t want to replicate to the production backup with my local work, so it’s not the best but I have a manual step that makes it pretty easy I first and this brings my database down to a folder I maintain locally. I have litestream installed on my desktop obviously, and here’s t…
Using Litestream to Backup QuadTask’s SQLite DB

Using Litestream to Backup QuadTask’s SQLite DB

Litestream This post will be a walkthrough of installing Litestream in a docker container that runs my FastAPI app in order to replicate the sqlite db in the data volume currently hosted in Fly’s volume manager to my MinIO instance. From there, on my development machine I can use litestream to restore the prod database to my dev environment to practice whatever I may need to practice with real production data! Dockerfile # Installing litestream in the dockerfile is 2-3 lines of code - no sweat. Configuration file is further down the post. Litestream Configuration # Taking care to set appropriately in each environment, the litestream configuration gets that env var templated out to the path for the litestream target. See docs Authentication # In your docker container you’ll need to set and which you setup in Minio - see Setup Remote MinIO S3 Backend Target for Litestream. I have these set as secrets in my fly configuration, and locally in a.env file that gets sourced with my compose sta…
Setup Remote MinIO S3 Backend Target for Litestream

Setup Remote MinIO S3 Backend Target for Litestream

Intro # I am starting to think through some patterns for replicating sqlite databases, exploring them, standardizing on schemas/models I use across projects, etc… Thanks to Waylon I know about Litestream and finally I started playing with it. Their quickstart is good, but it assumes you’ll run MinIO on the same machine you run litestream on. I, however, have MinIO setup in my homelab with the api endpoint accessible via DNS -. Before starting - I realize I left the credential aspect out - Litestream explains how to setup API keys in MinIO for their application here Basically after generating the keys I set and as env vars So let’s see what happens and then get to [the fix] So that is pretty simple… my login is wrong… but wait… Notice this line - … so was not the right replacement for. Also the inferred is the entire … Oh! Well I didn’t specify a bucket in the subdomain - I did it with a route on the URL… ok let’s try We got the same kind of error… This time the inferred bucket was … ok…