mydisha/mds-backup

Laravel 5 Command Line Tool for Backup Database

dev-master 2016-10-28 17:04 UTC

This package is not auto-updated.

Last update: 2024-12-16 15:31:12 UTC


README

Based on open source project https://github.com/larkinwhitaker/laravel-db-backup

Support Laravel Version 5, 5.1, 5.2, 5.3.

Installation

Update composer.json and put this package

"mydisha/mds-backup": "dev-master"

Or run following command

composer require mydisha/mds-backup

Next step, Edit Service Provider, located in config/app.php and put this into 'providers' array.

'providers' => array(
    'Mydisha\MdsBackup\DBBackupServiceProvider'
)

Configuration

Publish the configuration file into your project by run this command

php artisan vendor:publish

Usage

Backup

Create mysql dump file with default location in /storage/backup_db

php artisan db:backup
For specific database
php artisan db:backup --database=mysql

Restore

To restore the dump mysql file, run this following command

php artisan db:restore [dbname]

To show list of dump file, run this following command

php artisan db:restore

Change Initial Dump Filename

by default this package using datetime as file name, but you can change the filename started with your custome name, ex : laravel-date.sql

you can change at config file mds-backup.php

    'initial_name' => '',

Original Contributor

https://github.com/larkinwhitaker