borex / backupmanager

Admin interface for managing DB backups and file backups in Laravel 5.2+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backpack\BackupManager

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Style CI Total Downloads

An admin interface for managing backups (download and delete). Used in the Backpack package, on Laravel 5.2+

Subscribe to the Mailchimp list to be up to date with the community.

Backpack\BackupManager screenshot

Install

  1. In your terminal
$ composer require backpack/backupmanager
  1. Then add the service providers to your config/app.php file:
'Spatie\Backup\BackupServiceProvider',
'Backpack\BackupManager\BackupManagerServiceProvider',
  1. Publish the config file and lang files:
php artisan vendor:publish --provider="Backpack\BackupManager\BackupManagerServiceProvider"
  1. Add a new "disk" to config/filesystems.php:
        // used for Backpack/BackupManager
        'backups' => [
            'driver' => 'local',
            'root'   => storage_path('backups'), // that's where your backups are stored by default: storage/backups
        ],

This is where you choose a different driver if you want your backups to be stored somewhere else (S3, Dropbox, Google Drive, Box, etc).

  1. [optional] Add a menu item for it in resources/views/vendor/backpack/base/inc/sidebar.blade.php or menu.blade.php:
<li><a href="{{ url('admin/backup') }}"><i class="fa fa-hdd-o"></i> <span>Backups</span></a></li>
  1. [optional] Modify your backup options in config/laravel-backup.php

  2. [optional] Instruct Laravel to run the backups automatically in your console kernel:

// app/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
   $schedule->command('backup:clean')->daily()->at('04:00');
   $schedule->command('backup:run')->daily()->at('05:00');
}
  1. Check that it works

If the "unknown error" yellow bubble is thrown and you see the "Backup failed because The dump process failed with exitcode 127 : Command not found." error in the log file, either mysqldump / pg_dump is not installed or you need to specify its location.

You can do that in your config/database.php file, where you define your database credentials, by adding the dump_command_path variable. Example for Mac OS X's MAMP:

'mysql' => [
            'driver'            => 'mysql',
            'host'              => env('DB_HOST', 'localhost'),
            'database'          => env('DB_DATABASE', 'forge'),
            'username'          => env('DB_USERNAME', 'forge'),
            'password'          => env('DB_PASSWORD', ''),
            'charset'           => 'utf8',
            'collation'         => 'utf8_unicode_ci',
            'prefix'            => '',
            'strict'            => false,
            'engine'            => null,
            'dump_command_path' => '/Applications/MAMP/Library/bin/', // only the path, so without 'mysqldump' or 'pg_dump'
            'dump_command_timeout' => 60 * 5, // 5 minute timeout
            'dump_using_single_transaction' => true, // perform dump using a single transaction
        ],

Usage

Point and click, baby. Point and click.

Try at your-project-domain/admin/backup

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email hello@tabacitu.ro instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Admin interface for managing DB backups and file backups in Laravel 5.2+

License:MIT License


Languages

Language:PHP 100.0%