ziffmedia / laravel-mysql-snapshots
A set of commands that will create and load MySQL snapshots with the mysql-client command line tools
Installs: 89 240
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 14
Forks: 1
Open Issues: 2
Requires
- php: >=8.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-20 20:42:10 UTC
README
Laravel Mysql Snapshots
Installation
You can install the package via composer:
composer require ziffmedia/laravel-mysql-snapshots
You can publish the config file with:
php artisan vendor:publish --provider='ZiffMedia\LaravelMysqlSnapshots\MysqlSnapshotsServiceProvider'
Note: the configuration file will lock writing new snapshots to disk to the production
environment
while loading snapshots will be locked to the local
environment.
Usage
List Snapshots
artisan mysql-snapshots:list
Create Snapshots
artisan mysql-snapshots:create daily
To create snapshots, and automatically cleanup up old snapshots:
artisan mysql-snapshots:create daily --cleanup
Load Snapshots
To load the newest snapshot in the first available plan:
artisan mysql-snapshots:load
With Plan:
artisan mysql-snapshots:load daily
Additional options
--cached
Keeps a copy of the snapshot so that you don't need to redownload it on the next run
--recached
Downloads a fresh sql file, even if one exists locally, and then keeps it cached
--no-drop
Do not drop all tables in the database before loading the snapshot