Skip to content

Laravel package for creating MySQL Snapshots with command line tools mysqldump, mysql, etc.

Notifications You must be signed in to change notification settings

ziffmedia/laravel-mysql-snapshots

Repository files navigation

Laravel Mysql Snapshots
R

Installation

You can install the package via composer:

compose 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-snapshot:list

Create Snapshots

artisan mysql-snapshot:create daily

To create snapshots, and automatically cleanup up old snapshots:

artisan mysql-snapshot:create daily --cleanup

Load Snapshots

To load the newest snapshot in the first available plan:

artisan mysql-snapshot:load

With Plan:

artisan mysql-snapshot: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

About

Laravel package for creating MySQL Snapshots with command line tools mysqldump, mysql, etc.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages