Migration from Litestream
Walrust and Litestream solve the same problem (SQLite WAL replication to S3) but their backups are not interchangeable. This guide helps you migrate from Litestream to walrust.
Compatibility
Section titled “Compatibility”What’s Similar
Section titled “What’s Similar”Both tools use:
- WAL-based replication - same underlying mechanism
- S3 storage layout - similar directory structure
- GFS retention - same retention policy model
- LTX-derived format - same origin, but walrust’s checksums break Litestream compatibility
What’s Different
Section titled “What’s Different”| Feature | Litestream | Walrust |
|---|---|---|
| Memory (1 DB) | 36 MB | 19 MB |
| Memory (100 DBs) | 160 MB | 20 MB |
| Language | Go | Rust |
| Config format | YAML | TOML |
| Metrics | Prometheus | Prometheus |
Feature Comparison
Section titled “Feature Comparison”Both tools support: WAL-based continuous replication, S3-compatible storage (AWS, Tigris, R2, MinIO), point-in-time recovery, GFS retention, multiple databases per process, checksum verification, Prometheus metrics.
Litestream only: SFTP and Azure Blob storage backends.
Walrust only: Python API, read replicas with polling, disk cache for upload queue, webhook notifications, circuit breaker, structured exit codes (0-6).
Migration Steps
Section titled “Migration Steps”1. Install Walrust
Section titled “1. Install Walrust”# Rustcargo install walrust
# Python (optional)pip install walrustVerify installation:
walrust --version2. Stop Litestream
Section titled “2. Stop Litestream”# systemdsudo systemctl stop litestream
# Dockerdocker stop litestream3. Convert Configuration
Section titled “3. Convert Configuration”Litestream uses YAML, walrust uses TOML.
Litestream config (litestream.yml):
dbs: - path: /data/app.db replicas: - name: s3 type: s3 bucket: my-backups path: app.db endpoint: https://fly.storage.tigris.dev retention: hourly: 24 daily: 7 weekly: 12 monthly: 12 snapshot-interval: 1h sync-interval: 1sWalrust config (walrust.toml):
[s3]bucket = "s3://my-backups"endpoint = "https://fly.storage.tigris.dev"
[sync]snapshot_interval = 3600 # 1 hour in secondswal_sync_interval = 1 # 1 second
[retention]hourly = 24daily = 7weekly = 12monthly = 12
[[databases]]path = "/data/app.db"prefix = "app.db" # Matches Litestream's path4. Verify S3 Credentials
Section titled “4. Verify S3 Credentials”Both tools use standard AWS environment variables:
export AWS_ACCESS_KEY_ID=your-keyexport AWS_SECRET_ACCESS_KEY=your-secretexport AWS_ENDPOINT_URL_S3=https://fly.storage.tigris.dev # for Tigris5. Take a Fresh Snapshot
Section titled “5. Take a Fresh Snapshot”Since walrust backups are not compatible with Litestream, start fresh:
walrust snapshot /data/app.db \ --bucket my-backups \ --endpoint https://fly.storage.tigris.devThis creates a new walrust-format snapshot. Your old Litestream backups remain in S3 if you need to roll back.
6. Start Walrust
Section titled “6. Start Walrust”# CLIwalrust watch /data/app.db \ --bucket my-backups \ --endpoint https://fly.storage.tigris.dev
# Or with config filewalrust watch --config walrust.toml7. Update systemd Service (if applicable)
Section titled “7. Update systemd Service (if applicable)”Old (Litestream):
[Service]ExecStart=/usr/local/bin/litestream replicateNew (Walrust):
[Service]ExecStart=/usr/local/bin/walrust watch \ /data/app.db \ --bucket my-backups \ --endpoint https://fly.storage.tigris.devReload and restart:
sudo systemctl daemon-reloadsudo systemctl restart walrustsudo systemctl status walrust8. Monitor for Issues
Section titled “8. Monitor for Issues”Watch logs:
# systemdsudo journalctl -u walrust -f
# Dockerdocker logs -f walrust
# Directexport RUST_LOG=walrust=infowalrust watch /data/app.db --bucket my-backupsCheck that snapshots are being uploaded:
walrust list --bucket my-backups --endpoint https://fly.storage.tigris.devConfiguration Mapping
Section titled “Configuration Mapping”Global Settings
Section titled “Global Settings”| Litestream | Walrust | Notes |
|---|---|---|
addr (metrics) | --metrics-port | Default: 16767 |
log-level | RUST_LOG env | Use RUST_LOG=walrust=info |
Replica Settings
Section titled “Replica Settings”| Litestream | Walrust | Notes |
|---|---|---|
bucket | [s3].bucket | Add s3:// prefix in walrust |
endpoint | [s3].endpoint | Same format |
path | [[databases]].prefix | S3 prefix for database |
snapshot-interval | [sync].snapshot_interval | Seconds in walrust |
sync-interval | [sync].wal_sync_interval | Seconds in walrust |
retention | [retention] | Same structure |
validation-interval | [sync].validation_interval | Seconds in walrust |
Database Settings
Section titled “Database Settings”| Litestream | Walrust | Notes |
|---|---|---|
dbs[].path | [[databases]].path | Same |
| Per-DB snapshot interval | [[databases]].snapshot_interval | Override global |
| Per-DB retention | [[databases]].retention | Override global |
Command Mapping
Section titled “Command Mapping”| Litestream Command | Walrust Equivalent |
|---|---|
litestream replicate | walrust watch |
litestream snapshots <db> | walrust list --bucket <bucket> |
litestream restore <db> <path> | walrust restore <db> -o <path> --bucket <bucket> |
litestream restore -timestamp <time> | walrust restore --point-in-time <time> |
litestream databases | walrust list --bucket <bucket> |
litestream version | walrust --version |
litestream generations | (Not implemented) |
litestream wal | (Not implemented) |
Advanced Migration
Section titled “Advanced Migration”Migrating Multiple Databases
Section titled “Migrating Multiple Databases”Litestream:
dbs: - path: /data/app.db - path: /data/users.db - path: /data/analytics.dbWalrust:
[[databases]]path = "/data/app.db"
[[databases]]path = "/data/users.db"
[[databases]]path = "/data/analytics.db"Or use wildcards:
[[databases]]path = "/data/*.db"Per-Database Configuration
Section titled “Per-Database Configuration”Litestream:
dbs: - path: /data/critical.db replicas: - name: s3 snapshot-interval: 5m # More frequent retention: hourly: 48 - path: /data/logs.db replicas: - name: s3 snapshot-interval: 1h # Less frequentWalrust:
[[databases]]path = "/data/critical.db"snapshot_interval = 300 # 5 minutesretention = { hourly = 48, daily = 7, weekly = 12, monthly = 12 }
[[databases]]path = "/data/logs.db"snapshot_interval = 3600 # 1 hour (inherits global retention)Docker Compose
Section titled “Docker Compose”Litestream:
services: litestream: image: litestream/litestream command: replicate volumes: - app-data:/data - ./litestream.yml:/etc/litestream.ymlWalrust:
services: walrust: image: walrust command: watch /data/app.db --bucket my-backups volumes: - app-data:/data:ro environment: AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} AWS_ENDPOINT_URL_S3: https://fly.storage.tigris.devRollback Plan
Section titled “Rollback Plan”If you need to roll back to Litestream:
- Stop walrust:
sudo systemctl stop walrust- Restart Litestream:
sudo systemctl start litestream- Your existing Litestream backups are still in S3 — Litestream will continue from the last TXID
Note: Walrust backups cannot be restored by Litestream, so rolling back means losing any backups taken while using walrust.
See Also
Section titled “See Also”- Benchmark Results — memory/latency comparison data
- Configuration Reference — all config options
- Litestream docs — if you need to switch back