Skip to content

crispusomollo/DB-Backup-Utility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Database Backup Utility (CLI Tool)

GitHub repo size GitHub last commit GitHub issues GitHub pull requests GitHub contributors GitHub stars

Python Version License Build Status Platform

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.

Quick Start

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

Features

  • 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)

Usage examples

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

Project Layout

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)

License

MIT

About

A cross-DB CLI tool to backup and restore databases (MySQL, PostgreSQL, MongoDB, SQLite, and extensible to others). Includes scheduling, compression, local & cloud storage, logging, and restore features.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors