2017 © Pedro Peláez
 

library laravel

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

image

backup-manager/laravel

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  • Monday, June 18, 2018
  • by ShawnMcCool
  • Repository
  • 31 Watchers
  • 519 Stars
  • 279,371 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 110 Forks
  • 12 Open issues
  • 29 Versions
  • 8 % Grown

The README.md

Laravel Driver for the Database Backup Manager

This package pulls in the framework agnostic Backup Manager and provides seamless integration with Laravel., (*1)

Watch a video tour to get an idea what is possible with this package., (*2)

Note: This package is for Laravel integration only. For information about the framework-agnostic core package (or the Symfony driver) please see the base package repository., (*3)

Table of Contents

Stability Notice

It's stable enough, you'll need to understand filesystem permissions., (*4)

This package is being actively developed, and we would like to get feedback to improve it. Please feel free to submit feedback., (*5)

Requirements

  • PHP 7.3+
  • Laravel 5.5+
  • MySQL support requires mysqldump and mysql command-line binaries
  • PostgreSQL support requires pg_dump and psql command-line binaries
  • Gzip support requires gzip and gunzip command-line binaries

Installation

Composer, (*6)

Run the following to include this via Composer, (*7)

composer require backup-manager/laravel

Then, you'll need to select the appropriate packages for the adapters that you want to use., (*8)

# to support s3 or google cs
composer require league/flysystem-aws-s3-v3

# to support dropbox
composer require srmklive/flysystem-dropbox-v2

# to support rackspace
composer require league/flysystem-rackspace

# to support sftp
composer require league/flysystem-sftp

# to support gcs
composer require superbalist/flysystem-google-storage

Laravel 5 Configuration

To install into a Laravel project, first do the composer install then add *ONE *of the following classes to your config/app.php service providers list., (*9)

// FOR LARAVEL 5.5 +
BackupManager\Laravel\Laravel55ServiceProvider::class,

Publish the storage configuration file., (*10)

php artisan vendor:publish --provider="BackupManager\Laravel\Laravel55ServiceProvider"

The Backup Manager will make use of Laravel's database configuration. But, it won't know about any connections that might be tied to other environments, so it can be best to just list multiple connections in the config/database.php file., (*11)

We can also add extra parameters on our backup manager commands by configuring extra params on .env file:, (*12)

BACKUP_MANAGER_EXTRA_PARAMS="--column-statistics=0 --max-allowed-packet"

Lumen Configuration

To install into a Lumen project, first do the composer install then add the configuration file loader and ONE of the following service providers to your bootstrap/app.php., (*13)

// FOR LUMEN 5.5 AND ABOVE
$app->configure('backup-manager');
$app->register(BackupManager\Laravel\Lumen55ServiceProvider::class);

Copy the vendor/backup-manager/laravel/config/backup-manager.php file to config/backup-manager.php and configure it to suit your needs., (*14)

IoC Resolution, (*15)

BackupManager\Manager can be automatically resolved through constructor injection thanks to Laravel's IoC container., (*16)

use BackupManager\Manager;

public function __construct(Manager $manager) {
    $this->manager = $manager;
}

It can also be resolved manually from the container., (*17)

$manager = App::make(\BackupManager\Manager::class);

Artisan Commands, (*18)

There are three commands available db:backup, db:restore and db:list., (*19)

All will prompt you with simple questions to successfully execute the command., (*20)

Example Command for 24hour scheduled cronjob, (*21)

php artisan db:backup --database=mysql --destination=dropbox --destinationPath=project --timestamp="d-m-Y" --compression=gzip

This command will backup your database to dropbox using mysql and gzip compresion in path /backups/project/DATE.gz (ex: /backups/project/31-7-2015.gz), (*22)

Scheduling Backups

It's possible to schedule backups using Laravel's scheduler., (*23)

/**
 * Define the application's command schedule.
 *
 * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
 * @return void
 */
 protected function schedule(Schedule $schedule) {
     $environment = config('app.env');
     $schedule->command(
         "db:backup --database=mysql --destination=s3 --destinationPath=/{$environment}/projectname --timestamp="Y_m_d_H_i_s" --compression=gzip"
         )->twiceDaily(13,21);
 }

Contribution Guidelines

We recommend using the vagrant configuration supplied with this package for development and contribution. Simply install VirtualBox, Vagrant, and Ansible then run vagrant up in the root folder. A virtualmachine specifically designed for development of the package will be built and launched for you., (*24)

When contributing please consider the following guidelines:, (*25)

  • please conform to the code style of the project, it's essentially PSR-2 with a few differences.
    1. The NOT operator when next to parenthesis should be surrounded by a single space. if ( ! is_null(...)) {.
    2. Interfaces should NOT be suffixed with Interface, Traits should NOT be suffixed with Trait.
  • All methods and classes must contain docblocks.
  • Ensure that you submit tests that have minimal 100% coverage.
  • When planning a pull-request to add new functionality, it may be wise to submit a proposal to ensure compatibility with the project's goals.

Maintainers

This package is maintained by Shawn McCool and open-source heroes., (*26)

License

This package is licensed under the MIT license., (*27)

Changelog

2.0, (*28)

Released on 2020-04-30, (*29)

Remove support for all Laravel versions below 5.5. All older versions should use the backup-manager ^1.0., (*30)

Since so many dependencies in Laravel / Symfony have changed it became impossible to support newer versions in the same code-base. Release ^1.0 is stable and is always accepting new stability fixes (we haven't seen anything to fix in a long time)., (*31)

The Versions

18/06 2018

dev-master

9999999-dev

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

18/06 2018

1.3.1

1.3.1.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

12/02 2018

1.3.0

1.3.0.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

28/09 2017

1.2.2

1.2.2.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

08/09 2017

1.2.1

1.2.1.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

31/07 2017

1.2.0

1.2.0.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

15/11 2016

1.1.2

1.1.2.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

22/02 2016

1.1.1

1.1.1.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

05/02 2016

2.0.x-dev

2.0.9999999.9999999-dev

Database backup manager seamlessly integrated with Laravel 5.2 (minimum) with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

11/01 2016

1.1.0

1.1.0.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

07/12 2015

1.0.3

1.0.3.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/11 2015

1.0.2

1.0.2.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/11 2015

1.0.1

1.0.1.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

23/06 2015

1.0.0

1.0.0.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

23/06 2015

0.2.9

0.2.9.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

20/06 2015

0.2.8

0.2.8.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

19/06 2015

0.2.7

0.2.7.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

19/06 2015

0.2.6

0.2.6.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2015

0.2.5

0.2.5.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2015

0.2.4

0.2.4.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2015

0.2.3

0.2.3.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2015

0.2.2

0.2.2.0

Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2015

0.2.1

0.2.1.0

Laravel Integration for the Backup Manager - dump to and restore databases from S3, Dropbox, FTP, and SFTP.

  Sources   Download

MIT

The Requires

 

The Development Requires

16/06 2015

0.2.0

0.2.0.0

Laravel Integration for the Backup Manager - dump to and restore databases from S3, Dropbox, FTP, and SFTP.

  Sources   Download

MIT

The Requires

 

The Development Requires

16/06 2015

0.1.2

0.1.2.0

Laravel 4 Integration for the Backup Manager - dump to and restore databases from S3, Dropbox, FTP, and SFTP.

  Sources   Download

MIT

The Requires

 

The Development Requires

16/06 2015

0.1.1

0.1.1.0

Laravel 4 Integration for the Backup Manager - dump to and restore databases from S3, Dropbox, FTP, and SFTP.

  Sources   Download

MIT

The Requires

 

The Development Requires

16/06 2015

0.1.0

0.1.0.0

Laravel 4 Integration for the Backup Manager - dump to and restore databases from S3, Dropbox, FTP, and SFTP.

  Sources   Download

MIT

The Requires

 

The Development Requires

10/06 2015

0.0.2

0.0.2.0

Laravel 4 Integration for the Backup Manager - dump to and restore databases from S3, Dropbox, FTP, and SFTP.

  Sources   Download

MIT

The Requires

 

The Development Requires

10/06 2015

0.0.1

0.0.1.0

Laravel 4 Integration for the Backup Manager - dump to and restore databases from S3, Dropbox, FTP, and SFTP.

  Sources   Download

MIT

The Requires

 

The Development Requires