Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bastien70/dbsaver
A Symfony application for managing and automating regular backups of MySQL databases.
https://github.com/bastien70/dbsaver
hacktoberfest php symfony
Last synced: 3 months ago
JSON representation
A Symfony application for managing and automating regular backups of MySQL databases.
- Host: GitHub
- URL: https://github.com/bastien70/dbsaver
- Owner: bastien70
- License: mit
- Created: 2021-08-18T11:53:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-10T09:23:53.000Z (over 1 year ago)
- Last Synced: 2023-08-10T11:57:30.256Z (over 1 year ago)
- Topics: hacktoberfest, php, symfony
- Language: PHP
- Homepage:
- Size: 1.81 MB
- Stars: 40
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# DbSaver
[![Package version](https://img.shields.io/github/v/release/bastien70/dbsaver.svg?style=flat-square)](https://github.com/bastien70/dbsaver/releases)
[![Build Status](https://img.shields.io/github/workflow/status/bastien70/dbsaver/Continuous%20Integration/main?style=flat-square)](https://github.com/bastien70/dbsaver/actions?query=workflow%3A"Continuous+Integration"+branch%3Amain)
[![License](https://img.shields.io/badge/license-MIT-red.svg?style=flat-square)](LICENSE)
[![Code coverage](https://img.shields.io/codecov/c/github/bastien70/dbsaver?style=flat-square)](https://codecov.io/gh/bastien70/dbsaver/branch/main)![Database list](docs/images/database-list.png?raw=true)
DbSaver is an application written by **Bastien LOUGHIN** allowing you to make automatic daily backups (and manual backups) for your MySQL databases.
All you have to do is fill the credentials to access the databases, configure a CRON job... and it's done.
Passwords will be automatically hashed.Then, using DbSaver, you can access your databases backups by browsing the **Backups** tab.
You can then use DbSaver to access databases backups by going to the **Backups** tab.
Backups can be saved **locally** or in **S3 cloud** (AWS, Scaleway, ...)./!\ DbSaver only backups databases. Files (like image uploads) are not saved.
# Table of contents
1. [Prerequisites](#prerequisites)
1. [Manual install](#manual-install)
1. [Install using Task](#task-install)
1. [Configure the CRON job](#cron)
1. [Use the application](#use-app)
1. [Login](#login)
1. [Manage storage spaces](#storage-spaces)
1. [Manage databases](#databases)
1. [Manage backups](#backups)
1. [Update the application](#update-app)
1. [License](#license)
1. [Contribute](#contribute)
1. [Changelog](#changelog)* PHP 8.1+
* Composer
* Symfony CLI (if you want to run the project locally)1. `git clone https://github.com/bastien70/dbsaver.git`
1. `cd dbsaver`
1. `composer install --optimize-autoloader` (install dependencies)
1. `php bin/console app:post-install` (project configuration)
1. `php bin/console app:regenerate-app-secret` (regenerate the secret key allowing to hash databases passwords)
1. `php bin/console d:d:c` (create database)
1. `php bin/console d:m:m -n` (migrate tables)
1. `php bin/console app:make-user` (create your account)Requires [Symfony CLI](https://symfony.com/download) and [Task](https://taskfile.dev/) to be installed.
1. `git clone https://github.com/bastien70/dbsaver.git`
1. `cd dbsaver`
1. `task install`
1. If you want to run Docker containers (currently only for local emails with MailCatcher): `task docker-start` et `task docker-stop` (requires Docker and Docker Compose)
1. To start the server: `task start` (to stop it: `task stop`)Configure the CRON task allows you to activate the verification of backups to be made. **Set it up to run every day**.
When you add databases, you can each time configure the periodicity of the backups to be made.
The CRON task will automatically fetch the databases that need to be backed up and perform the automatic backup.Here is the command to run: `php bin/console app:backup`
Initialize a CRON job on your server or computer:
`[path to php] [path to project root]/bin/console app:backup`
After deploying the application on your server (or launching it locally) access the login page.
For the example the host will be `127.0.0.1:8000`.Access the app: https://127.0.0.1:8000/login
You'll be asked to log in. Enter your account credentials (that you created using the `php bin/console app:make-user` command).
![Authentication](docs/images/login.png?raw=true)
You will be redirected to https://127.0.0.1:8000/
![Homepage](docs/images/home.png?raw=true)
To create a storage space (locally or using S3), click on the `Storage spaces` tab then on the one you want. Then click on `Add storage space`.
Fill in the information for your storage space and validate.![Add storage space](docs/images/adapter-create.png?raw=true)
You will find this storage space in the list.
![Storage space list](docs/images/adapter-list.png?raw=true)
To create a database, click the `Databases` tab, then the `Add a database` button.
Fill your database information.Then, check the **backup options**
to your needs.Finally, configure the **periodicity** at which a backup must be executed for your database (example: every day, every 2 weeks, every 3 months, ...)
![Add a database](docs/images/database-create.png?raw=true)
Then, for every database you add, you will be able to see its backups, update its credentials, delete the database from the app (and its backups) or launch a manual backup.
![Database list](docs/images/database-list.png?raw=true)
To access your databases backups, click the `Backups` tab.
![Backup list](docs/images/backup-list.png?raw=true)
You will be able to download, restore or delete a backup.
If you have Task and Symfony CLI installed, just run this command: `task update`
Else run the following commands instead:
```bash
git pull --rebase
composer install --optimize-autoloader
php bin/console doctrine:migrations:migrate --no-interaction
php bin/console app:post-install --only-missing
```This application is protected by a MIT license: [LICENCE](../LICENSE).
Before making a pull request, don't forget to run these commands (requires Task and Docker Compose):
```bash
task ci
task test
```Note: you can run these commands without Task, have a look to the [Taskfile.yaml](Taskfile.yaml) file to see which commands will run.
See the [changelog](CHANGELOG.md).