A cross-platform command-line utility for backing up and restoring databases (MySQL, PostgreSQL, MongoDB, SQLite). Includes compression, S3/GCS/Azure storage, logging, scheduling, and selective-table restore.
git clone https://github.com/crispusomollo/DB-Backup-Utility.git
cd DB-Backup-Utility
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m dbbackup.cli --help-
Multi-DB support: MySQL, PostgreSQL, MongoDB, SQLite
-
Selective-table restore (MySQL & PostgreSQL)
-
Compression (.tar.gz)
-
Local and cloud storage (AWS S3, Google Cloud Storage, Azure Blob)
-
Logging and optional Slack notifications
-
Scheduling support (cron/systemd/Task Scheduler)
Full backup:
python -m dbbackup.cli backup --dbtype postgres --host localhost --username admin --database mydb
Selective-table restore:
python -m dbbackup.cli restore --dbtype postgres --host localhost --username admin --database mydb --backup-path /backups/mydb.dump --tables users,orders
db-backup-utility/
├── README.md
├── LICENSE
├── pyproject.toml
├── requirements.txt
├── src/
│ ├── dbbackup/
│ │ ├── __init__.py
│ │ ├── cli.py # entrypoint (Click)
│ │ ├── config.py # config parsing (YAML/ENV)
│ │ ├── logger.py # centralized logging
│ │ ├── connectors.py # DB connector + test_connection
│ │ ├── backup.py # backup orchestration
│ │ ├── restore.py # restore orchestration
│ │ ├── storage.py # local & cloud (S3, GCS, Azure) upload/download
│ │ ├── compress.py # gzip / tar / zip helpers
│ │ └── scheduler.py # APScheduler wrapper (optional)
├── examples/
│ ├── mysql.example.yml
│ ├── postgres.example.yml
│ └── mongodb.example.yml
└── scripts/
├── install.sh
└── systemd/ (service + timer example)
MIT