Add optional KEEP_LOCAL_BACKUP environment variable to control local backup retention.
Default behavior remains unchanged: backup files are deleted locally after
successful upload, keeping deployments safe on Railway and other PaaS
platforms with ephemeral storage.
When KEEP_LOCAL_BACKUP=true is set, backups are preserved locally, which is
useful for CLI usage, local machines, VPS, or NAS workflows.
Documentation and CLI output were updated for clarity.
No breaking changes.
This is the first stable release of Postgres-to-R2 Backup.
### ✨ Key Features
- Automated PostgreSQL backups using `pg_dump`
- S3-compatible object storage support (Cloudflare R2, AWS S3, Wasabi, Backblaze B2, MinIO)
- Optional gzip compression or 7z encryption with password
- Backup retention with automatic cleanup
- Supports private and public database URLs
- UTC-based scheduling for consistent behavior across platforms
### 🐳 Docker & Deployment
- Multi-stage Docker build using Python 3.12
- Prebuilt Docker image support (`.tar` / `.tar.gz`)
- Designed for Railway deployment with cron support
- Works on VPS, Docker, and other PaaS providers
### 📄 Documentation & DX
- Expanded README with Docker, Railway, and S3 usage
- Added `.env.example` for easier configuration
- Added CONTRIBUTING guidelines
This release is production-ready and safe for existing users.
Summary
Improves overall backup performance and reliability for larger PostgreSQL databases
while keeping the solution fully compatible with Railway environments.
Changes
Uses PostgreSQL custom-format backups (pg_dump -Fc) for efficient storage
Enables multipart, threaded uploads to Cloudflare R2 for faster and more reliable transfers
Keeps backups restore-friendly, supporting parallel restores via pg_restore --jobs
Updates documentation to accurately reflect performance behavior
Notes on Parallelism
Parallel dumping (pg_dump --jobs) is intentionally not used, as it requires directory format
and is not suitable for Railway containers
Parallelism is supported at restore time using pg_restore --jobs with .dump files
Testing
Tested on Railway using the deps-update branch
Verified backup creation, encryption, upload, and retention cleanup
This update adds detailed logging for the final compressed backup file size before it is uploaded to R2.
### Why this is useful
- Provides visibility into the size of each backup
- Helps monitor database growth over time
- Confirms that compression or encryption worked correctly
- Useful for debugging storage or retention issues
### Notes
- Tested successfully on Railway
- Backup flow works as expected: pg_dump → compress/encrypt → size log → upload → cleanup
- No breaking changes introduced
This pull request updates two dependencies to their latest stable versions:
- boto3: 1.40.37 → 1.41.3
- python-dotenv: 1.1.1 → 1.2.1
These updates include upstream bug fixes, minor improvements, and compatibility updates for AWS SDK functionality and environment variable handling.
All updated packages have been tested in the current project environment:
- Application starts without errors
- AWS-related features work as expected
- Environment variable loading behaves normally
No breaking changes observed. Safe to merge.
### Summary
- Updated boto3 from **1.40.34 → 1.40.36**
### Why
- Keep AWS SDK up to date
- Ensures compatibility and includes the latest fixes
### Notes
- Tested on Railway with `deps-update` branch before merging
- No issues found
### Summary
- Updated boto3 from **1.40.34 → 1.40.36**
### Why
- Keep AWS SDK up to date
- Ensures compatibility and includes the latest fixes
### Notes
- Tested on Railway with `deps-update` branch before merging
- No issues found
Dependencies updated and verified on Railway:
- boto3 bumped to 1.40.34
- Backup scheduler runs successfully
- Upload, encryption, and cleanup tested
- No issues in logs
Safe to merge into `main`.