laravox / backup
Easy way to store and restore PostgreSQL backups
Requires
- php: ^8.0
README
🙌 Description
This library enables you to save and restore the current state of your database, allowing you to name and organize these backups for easy reference. The package proves particularly valuable when testing a functionality that may encounter failures, providing a straightforward command to effortlessly revert to a previously stable state when needed.
Already tested in:
Database | Version |
---|---|
MySQL | ^10.1.48-MariaDB |
Postgres | ^12.0 |
NOTE
The database user must have permissions for:
- create the database
- delete the database
🙌 Installation steps
- install the package.
composer require laravox/backup
🙌 Commands available
NOTE: all files are stored in storage/app/database/backups/
- Store the backup:
php artisan backuppy:store
it saves the current state of your database using the APP_NAME
variable in your .env file as the name of the backup. That means: <APP_NAME>.sql
- Store the backup with an specific name:
php artisan backuppy:store {name}
- restore the backup
it does the same than the previous command, but stores the file with the {name} typed.
php artisan backuppy:restore
- Restore the backup with an specific name:
restore the database stored with the APP_NAME
variable in your .env file
php artisan backuppy:restore {name}
- List all backups:
restore the database stored with the {name}
php artisan backuppy:list
- Delete all backups:
it shows a list of the backup stored with its names
php artisan backuppy:delete --all
Delete all backups
🙌 What's next?
-
Allows to delete an specific file using the {name} parameter.
-
the backup:list should not shows the extension '.sql'