{"id":39229612,"url":"https://github.com/ibrahimraimi/database-backup-utility","last_synced_at":"2026-01-17T23:39:45.777Z","repository":{"id":313100121,"uuid":"1050012380","full_name":"ibrahimraimi/database-backup-utility","owner":"ibrahimraimi","description":"A comprehensive command-line interface (CLI) utility for backing up and restoring any type of database","archived":false,"fork":false,"pushed_at":"2025-09-03T21:41:00.000Z","size":75,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-03T23:28:04.886Z","etag":null,"topics":["backup","cli","database","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibrahimraimi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-03T20:21:47.000Z","updated_at":"2025-09-03T21:42:36.000Z","dependencies_parsed_at":"2025-09-03T23:28:08.263Z","dependency_job_id":"9dc75fe1-8933-4731-9fe2-f5350def6194","html_url":"https://github.com/ibrahimraimi/database-backup-utility","commit_stats":null,"previous_names":["ibrahimraimi/database-backup-utility"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ibrahimraimi/database-backup-utility","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimraimi%2Fdatabase-backup-utility","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimraimi%2Fdatabase-backup-utility/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimraimi%2Fdatabase-backup-utility/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimraimi%2Fdatabase-backup-utility/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibrahimraimi","download_url":"https://codeload.github.com/ibrahimraimi/database-backup-utility/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimraimi%2Fdatabase-backup-utility/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28522311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T22:11:28.393Z","status":"ssl_error","status_checked_at":"2026-01-17T22:11:27.841Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","cli","database","go"],"created_at":"2026-01-17T23:39:45.710Z","updated_at":"2026-01-17T23:39:45.762Z","avatar_url":"https://github.com/ibrahimraimi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Database Backup Utility\n\nA comprehensive command-line interface (CLI) utility for backing up and restoring any type of database. The utility supports various database management systems (DBMS) such as MySQL, PostgreSQL, MongoDB, SQLite, and others. This tool features automatic backup scheduling, compression of backup files, storage options (local and cloud), and logging of backup activities.\n\n## Features\n\n✅ **Multi-Database Support**: MySQL, PostgreSQL, MongoDB, SQLite  \n✅ **Backup Types**: Full, incremental, and differential backups  \n✅ **Compression**: Built-in gzip compression to reduce storage space  \n✅ **Storage Options**: Local storage and cloud storage (AWS S3, Google Cloud Storage, Azure Blob Storage)  \n✅ **Restore Operations**: Full and selective restore capabilities  \n✅ **Logging**: Comprehensive logging with configurable levels and formats  \n✅ **Notifications**: Slack and Discord notifications for backup status  \n✅ **Cross-Platform**: Works on Windows, Linux, and macOS\n\n## Installation\n\n### Download Pre-built Binaries (Recommended)\n\nDownload the latest release for your platform:\n\n**Linux (AMD64):**\n\n```bash\ncurl -L -o dbu https://github.com/ibrahimraimi/database-backup-utility/releases/latest/download/dbu-linux-amd64\nchmod +x dbu\nsudo mv dbu /usr/local/bin/\n```\n\n**macOS (Intel):**\n\n```bash\ncurl -L -o dbu https://github.com/ibrahimraimi/database-backup-utility/releases/latest/download/dbu-darwin-amd64\nchmod +x dbu\nsudo mv dbu /usr/local/bin/\n```\n\n**macOS (Apple Silicon):**\n\n```bash\ncurl -L -o dbu https://github.com/ibrahimraimi/database-backup-utility/releases/latest/download/dbu-darwin-arm64\nchmod +x dbu\nsudo mv dbu /usr/local/bin/\n```\n\n**Windows (AMD64):**\n\n```powershell\n# Download using PowerShell\nInvoke-WebRequest -Uri \"https://github.com/ibrahimraimi/database-backup-utility/releases/latest/download/dbu-windows-amd64.exe\" -OutFile \"dbu.exe\"\n```\n\n### From Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/ibrahimraimi/database-backup-utility.git\ncd database-backup-utility\n\n# Build the binary\nmake build\n\n# Or build for all platforms\nmake build-all\n```\n\n### Using Go\n\n```bash\ngo install github.com/ibrahimraimi/database-backup-utility@latest\n```\n\n\u003e **Note:** For detailed download instructions and release information, see the [Releases Documentation](docs/releases.md).\n\n## Quick Start\n\n### Test Database Connection\n\n```bash\n# Test MySQL connection\n./dbu test --db-type mysql --host localhost --port 3306 --username root --password mypassword --database mydb\n\n# Test PostgreSQL connection\n./dbu test --db-type postgres --host localhost --port 5432 --username postgres --password mypassword --database mydb\n\n# Test MongoDB connection\n./dbu test --db-type mongodb --host localhost --port 27017 --username admin --password mypassword --database mydb\n\n# Test SQLite connection\n./dbu test --db-type sqlite --database /path/to/database.db\n```\n\n### Create a Backup\n\n```bash\n# MySQL backup\n./dbu backup --db-type mysql --host localhost --username root --password mypassword --database mydb --type full --compress\n\n# PostgreSQL backup\n./dbu backup --db-type postgres --host localhost --username postgres --password mypassword --database mydb --type full --compress\n\n# MongoDB backup\n./dbu backup --db-type mongodb --host localhost --username admin --password mypassword --database mydb --type full --compress\n\n# SQLite backup\n./dbu backup --db-type sqlite --database /path/to/database.db --type full --compress\n\n# Selective backup (specific tables)\n./dbu backup --db-type mysql --host localhost --username root --password mypassword --database mydb --tables \"users,orders,products\" --compress\n\n# Cloud storage backup\n./dbu backup --db-type mysql --host localhost --username root --password mypassword --database mydb --storage cloud --cloud-provider aws --bucket my-backup-bucket --region us-east-1\n```\n\n### Restore a Backup\n\n```bash\n# Restore from local backup\n./dbu restore --db-type mysql --host localhost --username root --password mypassword --database mydb --file ./backups/mysql_mydb_full_2024-01-15_10-30-00.sql.gz\n\n# Restore from cloud backup\n./dbu restore --db-type mysql --host localhost --username root --password mypassword --database mydb --file s3://my-backup-bucket/mysql_mydb_full_2024-01-15_10-30-00.sql.gz\n\n# Selective restore (specific tables)\n./dbu restore --db-type mysql --host localhost --username root --password mypassword --database mydb --file ./backups/mysql_mydb_full_2024-01-15_10-30-00.sql.gz --tables \"users,orders\"\n```\n\n## Configuration\n\nCreate a configuration file at `~/dbu.yaml`:\n\n```yaml\n# Logging configuration\nlog:\n  level: \"info\" # debug, info, warn, error\n  format: \"json\" # json, text\n\n# Storage configuration\nstorage:\n  type: \"local\" # local, cloud\n  path: \"./backups\"\n\n# Cloud storage configuration\ncloud:\n  provider: \"aws\" # aws, gcp, azure\n  bucket: \"my-backup-bucket\"\n  region: \"us-east-1\"\n\n# Notification configuration\nnotify:\n  enabled: true\n  type: \"slack\" # slack, discord\n  webhook: \"https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK\"\n  channel: \"#backups\"\n```\n\n## Environment Variables\n\n```bash\n# AWS S3\nexport AWS_ACCESS_KEY_ID=your_access_key\nexport AWS_SECRET_ACCESS_KEY=your_secret_key\nexport AWS_REGION=us-east-1\n\n# Google Cloud Storage\nexport GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json\n\n# Azure Blob Storage\nexport AZURE_STORAGE_ACCOUNT=your_storage_account\nexport AZURE_STORAGE_KEY=your_storage_key\n```\n\n## Command Reference\n\n### Global Flags\n\n- `--config`: Path to configuration file (default: ~/dbu.yaml)\n- `--log-level`: Log level (debug, info, warn, error)\n- `--log-format`: Log format (json, text)\n\n### Database Connection Flags\n\n- `--db-type`: Database type (mysql, postgres, mongodb, sqlite)\n- `--host`: Database host\n- `--port`: Database port\n- `--username`: Database username\n- `--password`: Database password\n- `--database`: Database name\n- `--connection-string`: Full database connection string\n\n### Backup Flags\n\n- `--type`: Backup type (full, incremental, differential)\n- `--compress`: Compress backup files (default: true)\n- `--tables`: Comma-separated list of tables for selective backup\n- `--storage`: Storage type (local, cloud)\n- `--path`: Local storage path\n- `--cloud-provider`: Cloud provider (aws, gcp, azure)\n- `--bucket`: Cloud storage bucket name\n- `--region`: Cloud storage region\n\n### Restore Flags\n\n- `--file`: Path to backup file to restore\n- `--tables`: Comma-separated list of tables for selective restore\n- `--drop-existing`: Drop existing tables before restore\n\n## Examples\n\n### Automated Backup Script\n\n```bash\n#!/bin/bash\n# daily-backup.sh\n\nDB_HOST=\"localhost\"\nDB_USER=\"root\"\nDB_PASS=\"mypassword\"\nDB_NAME=\"mydb\"\nBACKUP_DIR=\"/var/backups/db\"\n\n# Create backup\n./dbu backup \\\n  --db-type mysql \\\n  --host $DB_HOST \\\n  --username $DB_USER \\\n  --password $DB_PASS \\\n  --database $DB_NAME \\\n  --type full \\\n  --compress \\\n  --storage local \\\n  --path $BACKUP_DIR\n\n# Upload to cloud\n./dbu backup \\\n  --db-type mysql \\\n  --host $DB_HOST \\\n  --username $DB_USER \\\n  --password $DB_PASS \\\n  --database $DB_NAME \\\n  --type full \\\n  --compress \\\n  --storage cloud \\\n  --cloud-provider aws \\\n  --bucket my-backup-bucket \\\n  --region us-east-1\n```\n\n### Cron Job Setup\n\n```bash\n# Add to crontab for daily backups at 2 AM\n0 2 * * * /path/to/daily-backup.sh\n```\n\n## Development\n\n### Building from Source\n\n```bash\n# Install dependencies\nmake deps\n\n# Build the binary\nmake build\n\n# Run tests\nmake test\n\n# Run tests with coverage\nmake test-coverage\n\n# Format code\nmake fmt\n\n# Run linter\nmake lint\n```\n\n### Project Structure\n\n```\ndatabase-backup-utility/\n├── cmd/                    # CLI commands\n│   ├── root.go            # Root command\n│   ├── backup.go          # Backup command\n│   ├── restore.go         # Restore command\n│   └── test.go            # Test command\n├── internal/              # Internal packages\n│   ├── config/            # Configuration management\n│   ├── database/          # Database connection management\n│   ├── backup/            # Backup operations\n│   ├── restore/           # Restore operations\n│   ├── storage/           # Storage management\n│   ├── notification/      # Notification system\n│   └── logger/            # Logging utilities\n├── main.go                # Application entry point\n├── go.mod                 # Go module file\n├── Makefile              # Build automation\n└── README.md             # This file\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for your changes\n5. Run the test suite\n6. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Documentation\n\nComprehensive documentation is available in the `/docs` directory:\n\n- [Getting Started](docs/getting-started.md) - Quick start guide and installation\n- [Releases](docs/releases.md) - Download pre-built binaries and release information\n- [MySQL Guide](docs/mysql.md) - Complete MySQL backup and restore guide\n- [PostgreSQL Guide](docs/postgresql.md) - Complete PostgreSQL backup and restore guide\n- [MongoDB Guide](docs/mongodb.md) - Complete MongoDB backup and restore guide\n- [SQLite Guide](docs/sqlite.md) - Complete SQLite backup and restore guide\n- [Configuration](docs/configuration.md) - Configuration file setup and options\n- [Cloud Storage](docs/cloud-storage.md) - Cloud storage integration guide\n- [Notifications](docs/notifications.md) - Slack and Discord notification setup\n- [Troubleshooting](docs/troubleshooting.md) - Common issues and solutions\n- [Examples](docs/examples.md) - Real-world usage examples and scripts\n\n## Support\n\nFor support and questions:\n\n- Create an issue on GitHub\n- Check the [documentation](docs/README.md)\n- Review the [examples](docs/examples.md)\n- Check the [troubleshooting guide](docs/troubleshooting.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimraimi%2Fdatabase-backup-utility","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibrahimraimi%2Fdatabase-backup-utility","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimraimi%2Fdatabase-backup-utility/lists"}