2017 © Pedro Peláez
 

library backup-manager

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

image

nelsonkopliku/backup-manager

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  • Friday, November 25, 2016
  • by nelsonkopliku
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 152 Forks
  • 0 Open issues
  • 33 Versions
  • 0 % Grown

The README.md

Database Backup Manager 1.0

Latest Stable Version License Build Status Coverage Status Total Downloads, (*1)

This package provides a framework-agnostic database backup manager for dumping to and restoring databases from S3, Dropbox, FTP, SFTP, and Rackspace Cloud., (*2)

Watch a video tour showing the Laravel driver in action to give you an idea what is possible., (*3)

Table of Contents

Stability Notice

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

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

Quick and Dirty

Configure your databases., (*6)

// config/database.php
'development' => [
    'type' => 'mysql',
    'host' => 'localhost',
    'port' => '3306',
    'user' => 'root',
    'pass' => 'password',
    'database' => 'test',
],
'production' => [
    'type' => 'postgresql',
    'host' => 'localhost',
    'port' => '5432',
    'user' => 'postgres',
    'pass' => 'password',
    'database' => 'test',
],

Configure your filesystems., (*7)

// config/storage.php
'local' => [
    'type' => 'Local',
    'root' => '/path/to/working/directory',
],
's3' => [
    'type' => 'AwsS3',
    'key'    => '',
    'secret' => '',
    'region' => 'us-east-1',
    'version' => 'latest',
    'bucket' => '',
    'root'   => '',
],
'gcs' => [
    'type' => 'Gcs',
    'key'    => '',
    'secret' => '',
    'version' => 'latest',
    'bucket' => '',
    'root'   => '',
],
'rackspace' => [
    'type' => 'Rackspace',
    'username' => '',
    'key' => '',
    'container' => '',
    'zone' => '',
    'root' => '',
],
'dropbox' => [
    'type' => 'Dropbox',
    'key' => '',
    'secret' => '',
    'app' => '',
    'root' => '',
],
'ftp' => [
    'type' => 'Ftp',
    'host' => '',
    'username' => '',
    'password' => '',
    'root' => '',
    'port' => 21,
    'passive' => true,
    'ssl' => true,
    'timeout' => 30,
],
'sftp' => [
    'type' => 'Sftp',
    'host' => '',
    'username' => '',
    'password' => '',
    'root' => '',
    'port' => 21,
    'timeout' => 10,
    'privateKey' => '',
],

Backup to / restore from any configured database., (*8)

Backup the development database to Amazon S3. The S3 backup path will be test/backup.sql.gz in the end, when gzip is done with it., (*9)

$manager = require 'bootstrap.php';
$manager->makeBackup()->run('development', 's3', 'test/backup.sql', 'gzip');

Backup to / restore from any configured filesystem., (*10)

Restore the database file test/backup.sql.gz from Amazon S3 to the development database., (*11)

$manager = require 'bootstrap.php';
$manager->makeRestore()->run('s3', 'test/backup.sql.gz', 'development', 'gzip');

This package does not allow you to backup from one database type and restore to another. A MySQL dump is not compatible with PostgreSQL., (*12)

Requirements

  • PHP 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, (*13)

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

composer require backup-manager/backup-manager

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

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

# to support dropbox
composer require league/flysystem-dropbox

# to support rackspace
composer require league/flysystem-rackspace

# to support sftp
composer require league/flysystem-sftp

Usage

Once installed, the package must be bootstrapped (initial configuration) before it can be used., (*16)

We've provided a native PHP example here., (*17)

The required bootstrapping can be found in the example here., (*18)

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., (*19)

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

  • 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, Mitchell van Wijngaarden, and you!, (*21)

License

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

The Versions

25/11 2016

dev-master

9999999-dev

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

08/02 2016

2.0.x-dev

2.0.9999999.9999999-dev

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

05/02 2016

1.1.1

1.1.1.0

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

11/01 2016

1.1.0

1.1.0.0

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

07/12 2015

1.0.9

1.0.9.0

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/11 2015

1.0.8

1.0.8.0

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

19/06 2015

1.0.7

1.0.7.0

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2015

1.0.6

1.0.6.0

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2015

1.0.5

1.0.5.0

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2015

1.0.4

1.0.4.0

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2015

1.0.3

1.0.3.0

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

  Sources   Download

MIT

The Requires

 

The Development Requires