laravox/backup

Easy way to store and restore PostgreSQL backups

v1.5.3 2023-01-08 05:00 UTC

This package is auto-updated.

Last update: 2025-06-13 07:00:36 UTC


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

  1. install the package.
composer require laravox/backup

🙌 Commands available

NOTE: all files are stored in storage/app/database/backups/

  1. 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

  1. Store the backup with an specific name:
php artisan backuppy:store {name}
  1. restore the backup

it does the same than the previous command, but stores the file with the {name} typed.

php artisan backuppy:restore
  1. 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}
  1. List all backups:

restore the database stored with the {name}

php artisan backuppy:list
  1. 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?

  1. Allows to delete an specific file using the {name} parameter.

  2. the backup:list should not shows the extension '.sql'