{"id":23960498,"url":"https://github.com/geo-mena/backup","last_synced_at":"2026-04-25T22:33:30.855Z","repository":{"id":270525071,"uuid":"910603046","full_name":"geo-mena/backup","owner":"geo-mena","description":"📦 Database backup utility that can backup and restore any DB","archived":false,"fork":false,"pushed_at":"2025-01-01T19:43:42.000Z","size":81,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T00:14:39.122Z","etag":null,"topics":["cli","docker","laravel-zero","php","r2"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geo-mena.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-12-31T19:24:19.000Z","updated_at":"2025-01-10T16:25:07.000Z","dependencies_parsed_at":"2025-06-04T20:56:28.408Z","dependency_job_id":"99f1c798-03e4-4665-b3dd-7eb0589318b0","html_url":"https://github.com/geo-mena/backup","commit_stats":null,"previous_names":["geo-mena/backup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/geo-mena/backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geo-mena%2Fbackup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geo-mena%2Fbackup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geo-mena%2Fbackup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geo-mena%2Fbackup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geo-mena","download_url":"https://codeload.github.com/geo-mena/backup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geo-mena%2Fbackup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32279655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: 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":["cli","docker","laravel-zero","php","r2"],"created_at":"2025-01-06T19:28:54.927Z","updated_at":"2026-04-25T22:33:30.839Z","avatar_url":"https://github.com/geo-mena.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cp\u003e\n        \u003ch1 align=\"center\"\u003eDatabase Backup Utility \u003c/h1\u003e\n    \u003c/p\u003e\n    \u003cp\u003e\n    \n![Docker Badge](https://shields.io/badge/Docker-20.10.7-2496ED?logo=docker)\n![Laravel-zero Badge](https://shields.io/badge/Laravel%20Zero-11.36.1-FF2D20?logo=laravel)\n![PHP Badge](https://shields.io/badge/PHP-8.2-777BB4?logo=php)\n![PostgreSQL Badge](https://shields.io/badge/PostgreSQL-16-336791?logo=postgresql)\n![MySQL Badge](https://shields.io/badge/MySQL-8.0-4479A1?logo=mysql)\n![MongoDB Badge](https://shields.io/badge/MongoDB-5.0-47A248?logo=mongodb)\n\u003c/div\u003e\n\nA robust and flexible command-line utility for backing up [MySQL](https://www.mysql.com), [PostgreSQL](https://www.postgresql.org), and [MongoDB](https://www.mongodb.com) databases. Built with simplicity and power in mind, this tool offers a streamlined approach to database backups while providing advanced features for more complex requirements.\n\n---\n\n## 📑 Table of Contents\n\n1. [✨ Features](#-features)\n\n    - [Support for multiple databases](#support-for-multiple-databases)\n    - [Advanced backup options](#advanced-backup-options)\n\n2. [🚀 Installation](#-installation)\n\n3. [📋 Requirements](#-requirements)\n\n4. [💻 Usage](#-usage)\n\n    - [PostgreSQL](#postgresql)\n    - [MySQL](#mysql)\n    - [MongoDB](#mongodb)\n\n5. [🖥️ Interactive Mode](#️-interactive-mode)\n\n    - [TUI Features](#tui-features)\n        - [Main Menu](#main-menu)\n        - [Configuration Sections](#configuration-sections)\n        - [Real-time display](#real-time-display-of)\n\n6. [🔧 Available Options](#-available-options)\n\n7. [📁 File Structure](#-file-structure)\n\n8. [🐳 Container Information](#-container-information)\n\n9. [📌 Important Notes](#️-important-notes)\n\n10. [🐛 Troubleshooting](#-troubleshooting)\n\n    - [Permission Error](#permission-error)\n    - [Connection Error](#connection-error)\n\n11. [📂 Project Structure](#-project-structure)\n\n    - [Directory Layout](#directory-layout)\n    - [Key Files](#key-files)\n    - [Key Directories](#key-directories)\n\n12. [📝 License](#-license)\n\n13. [✨ Contributing](#-contributing)\n\n## ✨ Features\n\nSupport for multiple databases:\n\n-   [MySQL](https://www.mysql.com)\n-   [PostgreSQL](https://www.postgresql.org)\n-   [MongoDB](https://www.mongodb.com)\n\nAdvanced backup options:\n\n-   Automatic compression (.gz)\n-   Timestamped backups\n-   Generated file validation\n-   Detailed process information\n\n## 🚀 Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/geo-mena/backup.git\n```\n\n2. Install the dependencies:\n\n```bash\ncd backup\n```\n\n3. Initialize with Docker:\n\n```bash\n./init.sh\n```\n\n4. Build the Docker image:\n\n```bash\ndocker compose build --no-cache\n```\n\n5. Start the Docker container:\n\n```bash\ndocker compose up -d\n```\n\n6. Access the container:\n\n```bash\ndocker compose exec app sh\n```\n\n## 📋 Requirements\n\n-   [Docker](https://www.docker.com)\n-   [Docker Compose](https://docs.docker.com/compose)\n-   [Git](https://git-scm.com)\n\n## 💻 Usage\n\n### PostgreSQL\n\n```bash\ndocker compose run --rm app php application backup \\\n    --type=postgres \\\n    --host=your-host \\\n    --port=5432 \\\n    --database=your-db \\\n    --user=your-user \\\n    --password=your-password \\\n    --compress\n```\n\n### MySQL\n\n```bash\ndocker compose run --rm app php application backup \\\n    --type=mysql \\\n    --host=your-host \\\n    --port=3306 \\\n    --database=your-db \\\n    --user=root \\\n    --password=your-password \\\n    --compress\n```\n\n### MongoDB\n\n```bash\ndocker compose run --rm app php application backup \\\n    --type=mongodb \\\n    --host=your-host \\\n    --port=27017 \\\n    --database=your-db \\\n    --user=your-user \\\n    --password=your-password \\\n    --compress\n```\n\n## 🖥️ Interactive Mode\n\nThe utility includes a user-friendly Terminal User Interface (TUI) that makes it easier to configure and execute backups. To use the interactive mode:\n\n```bash\ndocker compose run --rm app php application backup:tui\n```\n\nThe TUI provides:\n\n-   Easy database type selection\n-   Interactive configuration menus\n-   Real-time validation\n-   Visual feedback\n-   Configuration preview\n-   Step-by-step guidance\n\n### TUI Features\n\n-   Main Menu:\n\n    -   Database type selection (MySQL, PostgreSQL, MongoDB)\n    -   Visual ASCII art interface\n    -   Color-coded options\n\n-   Configuration Sections:\n\n    -   Connection Settings\n    -   Database Settings\n    -   Output Settings\n\n-   Real-time display of:\n\n    -   Current configuration\n    -   Validation status\n    -   Process feedback\n\n## 🔧 Available Options\n\n| Option       | Description                                  | Default Value         |\n| ------------ | -------------------------------------------- | --------------------- |\n| `--type`     | Database type (`mysql`/`postgres`/`mongodb`) | `mysql`               |\n| `--host`     | Database host                                | `localhost`           |\n| `--port`     | Database port                                | `[depends on type]`   |\n| `--database` | Database name                                | **required**          |\n| `--user`     | Database user                                | -                     |\n| `--password` | Database password                            | -                     |\n| `--output`   | Output directory                             | `app/storage/backups` |\n| `--compress` | Compress the backup                          | `false`               |\n\n## 📁 File Structure\n\nBackups are stored in the storage/backups/ directory with the following format:\n\n```\n{database}_{type}_{date}.{extension}[.gz]\n```\n\nExample:\n\n```\nmydb_postgres_2024-12-31_18-30-00.sql.gz\n```\n\n## 🐳 Container Information\n\nThe container includes:\n\n-   PHP 8.2\n-   PostgreSQL Client 16\n-   MySQL Client\n-   MongoDB Tools\n\n## 📌 Important Notes\n\n-   Compressed backups use gzip (.gz)\n-   Using environment variables for passwords is recommended in production\n-   Timestamps are in UTC format\n\n## 🐛 Troubleshooting\n\n### Permission Error\n\nIf you encounter a permission error, run the following command:\n\n```bash\nchmod -R 755 storage\n```\n\n### Connection Error\n\nVerify that the host and port are accessible from the Docker container\n\n## 📂 Project Structure\n\n### Directory Layout\n\n```bash\nbackup-utility/\n├── app/\n│   ├── Commands/\n│   │   ├── BackupCommand.php\n│   │   └── BackupTUICommand.php\n│   └── Providers/\n├── config/\n├── docker/\n│   └── php/\n│       └── Dockerfile\n├── storage/\n│   └── backups/\n├── tests/\n├── composer.json\n└── docker-compose.yml\n```\n\n### Key Files\n\n-   `app/Commands/BackupCommand.php`: Core backup functionality implementation\n-   `app/Commands/BackupTUICommand.php`: Interactive TUI implementation\n-   `docker/php/Dockerfile`: Docker container configuration\n-   `docker-compose.yml`: Docker services configuration\n-   `composer.json`: PHP dependencies and project configuration\n-   `config/backup.php`: Backup configuration settings\n-   `storage/backups/`: Default backup storage directory\n-   `tests/`: Test suite directory\n\n### Key Directories\n\n-   `app/`: Contains the main application code\n-   `config/`: Configuration files\n-   `docker/`: Docker-related files\n-   `storage/`: Storage for backups and logs\n-   `tests/`: Test files\n\n## 📝 License\n\nThe **Database Backup Utility** is an open-source software licensed under the MIT license.\n\n## ✨ Contributing\n\nContributions are welcome! Please open an issue first to discuss any changes you'd like to make.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeo-mena%2Fbackup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeo-mena%2Fbackup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeo-mena%2Fbackup/lists"}