snapdb is a cross-platform, extensible database backup and restore utility written in Go. It supports PostgreSQL, MySQL, and MongoDB, making it easy to automate, compress, and manage backups for multiple database types. Designed for reliability and ease of use, snapdb works on Windows, Linux, and macOS.
- Multi-DB Support: Backup and restore for PostgreSQL, MySQL, and MongoDB.
- Backup Types: Full backups (incremental/differential coming soon).
- Compression: Automatic gzip compression of backup files.
- Storage Options: Save backups locally; cloud storage (AWS S3, GCS, Azure Blob) coming soon.
- Logging: Detailed logs of backup activities, including status and errors.
- Notifications: Optional Slack notifications on backup completion/failure.
- Restore: Restore databases from backup files; selective restore planned.
- User-Friendly CLI: Simple commands, clear help, and robust error handling.
- Incremental and differential backups for supported databases
- Cloud storage integration (AWS S3, Google Cloud Storage, Azure Blob)
- Selective restore for specific tables/collections
- Advanced scheduling and retention policies
-
Install Go (>= 1.22)
-
Clone the repo:
git clone https://github.com/ashutoshsuthar2020/snapdb.git cd snapdb
-
Edit your config file:
Update config.yaml with your database connection details. -
Run a backup:
go run main.go backup --config=config/config.yaml
Backups will be saved in the
backups/
directory and compressed automatically. -
Restore a backup (coming soon):
go run main.go restore --config=config/config.yaml --file=backups/your_backup.sql
snapdb reads your config file, connects to each database, runs the appropriate backup command, compresses the output, and saves it locally. All activities are logged, and you can enable Slack notifications for backup status. Restore operations will allow you to recover databases from backup files.
Contributions and feedback are welcome!
For more details, see the project repo.