Giter Site home page Giter Site logo

backup-manager / backup-manager Goto Github PK

View Code? Open in Web Editor NEW
1.7K 1.7K 223.0 610 KB

Database backup manager for dumping to and restoring databases from S3, Dropbox, FTP, SFTP, and Rackspace Cloud

License: MIT License

PHP 100.00%
backup backup-manager cloud database framework-agnostic laravel mysql php postgresql restore symfony

backup-manager's Introduction

Database Backup Manager

Latest Stable Version License Total Downloads

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

  • use version 2+ for >=PHP 7.3
  • use version 1 for <PHP 7.2

Watch a video tour showing the Laravel driver in action to give you an idea what is possible.

Table of Contents

Quick and Dirty

Configure your databases.

// config/database.php
'development' => [
    'type' => 'mysql',
    'host' => 'localhost',
    'port' => '3306',
    'user' => 'root',
    'pass' => 'password',
    'database' => 'test',
    // If singleTransaction is set to true, the --single-transcation flag will be set.
    // This is useful on transactional databases like InnoDB.
    // http://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_single-transaction
    'singleTransaction' => false,
    // Do not dump the given tables
    // Set only table names, without database name
    // Example: ['table1', 'table2']
    // http://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_ignore-table
    'ignoreTables' => [],
    // using ssl to connect to your database - active ssl-support (mysql only):
    'ssl'=>false,
    // add additional options to dump-command (like '--max-allowed-packet')
    'extraParams'=>null,
],
'production' => [
    'type' => 'postgresql',
    'host' => 'localhost',
    'port' => '5432',
    'user' => 'postgres',
    'pass' => 'password',
    'database' => 'test',
],

Configure your filesystems.

// config/storage.php
'local' => [
    'type' => 'Local',
    'root' => '/path/to/working/directory',
],
's3' => [
    'type' => 'AwsS3',
    'key'    => '',
    'secret' => '',
    'region' => 'us-east-1',
    'version' => 'latest',
    'bucket' => '',
    'root'   => '',
    'use_path_style_endpoint' => false,
],
'b2' => [
    'type' => 'B2',
    'key'    => '',
    'accountId' => '',
    'bucket' => '',
],
'gcs' => [
    'type' => 'Gcs',
    'key'    => '',
    'secret' => '',
    'version' => 'latest',
    'bucket' => '',
    'root'   => '',
],
'rackspace' => [
    'type' => 'Rackspace',
    'username' => '',
    'key' => '',
    'container' => '',
    'zone' => '',
    'root' => '',
],
'dropbox' => [
    'type' => 'DropboxV2',
    'token' => '',
    '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' => '',
],
'flysystem' => [
    'type' => 'Flysystem',
    'name' => 's3_backup',
    //'prefix' => 'upload',
],
'doSpaces' => [
    'type' => 'AwsS3',
    'key' => '',
    'secret' => '',
    'region' => '',
    'bucket' => '',
    'root' => '',
    'endpoint' => '',
    'use_path_style_endpoint' => false,
],
'webdav' => [
    'type' => 'Webdav',
    'baseUri' => 'http://myserver.com',
    'userName' => '',
    'password' => '',
    'prefix' => '',
],

Backup to / restore from any configured database.

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.

use BackupManager\Filesystems\Destination;

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

Backup to / restore from any configured filesystem.

Restore the database file test/backup.sql.gz from Amazon S3 to the development database.

$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.

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

Run the following to include this via Composer

composer require backup-manager/backup-manager

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

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

# to support b2
composer require mhetreramesh/flysystem-backblaze

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

# to install the preferred dropbox v2 driver
composer required spatie/flysystem-dropbox

# to install legacy dropbox v2 driver
composer require srmklive/flysystem-dropbox-v2

# to support rackspace
composer require league/flysystem-rackspace

# to support sftp
composer require league/flysystem-sftp

# to support webdav (supported by owncloud nad many other)
composer require league/flysystem-webdav

Usage

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

We've provided a native PHP example here.

The required bootstrapping can be found in the example here.

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.

When contributing please consider the following guidelines:

  • Code style is PSR-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. Given the project's simplicity it just makes sense.
  • 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 you!

Backwards Compatibility Breaks

3.0

Remove support for symfony 2. Specifically symfony/process versions < 3.x

License

This package is licensed under the MIT license. Go wild.

backup-manager's People

Contributors

ali1 avatar bberlijn avatar bcalik avatar benbridts avatar benr77 avatar casperlaitw avatar chromeorfirefox avatar cklm avatar cmfcmf avatar deefour avatar driesvints avatar gizzmoasus avatar godeg123 avatar grahamcampbell avatar hason avatar innerflamefact avatar jk avatar loren138 avatar lucasff avatar merobo avatar mikulas avatar mitchellvanw avatar nyholm avatar pborreli avatar rdohms avatar samnela avatar shawnmccool avatar shotman avatar vanodevium avatar wyrihaximus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backup-manager's Issues

RequestTimeTooSkewedException on backup

I get this when I try to run a backup.

[Aws\S3\Exception\RequestTimeTooSkewedException]
The difference between the request time and the current time is too large.

From start to finish, it takes about 10secs to make the commands.

The gzip'd sql files are only 8KB.

My VM is running a different timezone to that of my project, if that makes any difference.

    vagrant@homestead:~/www/ag-aus$ php artisan db:backup
    These arguments haven't been filled yet: database, destination, destinationPath, compression
    The following questions will fill these in for you.

    Available database connections: sqlite, mysql, pgsql, sqlsrv
    From which database connection you want to dump?mysql

    Available storage services: local, s3, rackspace, dropbox, ftp, sftp
    To which storage service you want to save?s3

    How do you want to name the backup? mysql-backups/ag-aus-local.sql

    Available compression types: null, gzip
    Which compression type you want to use?gzip

    Just to be sure...
    Do you want to create a backup of mysql, store it on s3 at mysql-backups/ag-aus-local.sql and compress it to gzip?

    Are these correct? [Y/n] y
    Dumping database and uploading...



      [Aws\S3\Exception\RequestTimeTooSkewedException]                            
      The difference between the request time and the current time is too large.  



    db:backup [--database[="..."]] [--destination[="..."]] [--destinationPath[="..."]] [--compression[="..."]]

From my logfile:

[2015-02-02 14:00:18] local.ERROR: Aws\S3\Exception\RequestTimeTooSkewedException: AWS Error Code: RequestTimeTooSkewed, Status Code: 403, AWS Request ID: ABE3226CE02932DC, AWS Error Type: client, AWS Error Message: The difference between the request time and the current time is too large., User-Agent: aws-sdk-php2/2.7.17 Guzzle/3.9.2 curl/7.35.0 PHP/5.5.15RC1 [] []

FileExistsException when restoring database

When I run php artisan db:restore, I get a FileExistsException at the end:

[League\Flysystem\FileExistsException] File already exists at path: development__2014-07-24__12-22-58.sql.gz

Curiously, I also get asked "From which database connection you want to dump?" (I answer mysql, which is the only option).

Minor console output mistake

When making a backup, the text output is slightly wrong: it's missing the final / separator between the backup folder and filename:

Dumping database and uploading...

Successfully dumped mysql, compressed with gzip and store it to local at /path/app/database/backupsstaging__2015-02-17__10-38-34.sql

That should read instead:

Dumping database and uploading...

Successfully dumped mysql, compressed with gzip and store it to local at /path/app/database/backups/staging__2015-02-17__10-38-34.sql

mkdir(): Permission denied

I got this setup for storage and when i run

db:backup from terminal

or

$manager = App::make('BigName\BackupManager\Manager');
$manager->makeBackup()->run('mysql', 'local', 'backup.sql', 'gzip');

from routes app

i got this error mkdir(): Permission denied

'local' => [
'type' => 'Local',
'root' => '/Application/MAMP/htdocs/laravel/public/uploads/',
],

SQLite Support

Hey, just a thought (and yes I know sqlite is just a file).

But it would be nice to say have support for SQLite files too. This way if you wanted to migrate from SQLite to MySQL or Postgres you could do it with a backup.

Anyone got any thoughts on this?

Pre-Connect and Post-Connect Hooks Proposal

I would like to add hooks prior to the database connection and immediately after the last database dump.
The calls in the codebase would look for the appropriately named file in the hooks directory, if that file exists it would be included at that time.
I would use these hooks to open an SSH tunnel to my db on a remote server and close it when I'm done. This way I don't need to open port 3306 on my remote server, and I can run backup-manager from my local machine to my local filesystem. It won't matter that my machine is behind a NAT, and I can backup my DBs to time machine, CrashPlan, Backblaze, whatever.

I'd be happy to include in the pull request sample pre-connect and post-connect hooks to manage the ssh tunnel, they would be named .sample.php so they would not be run unless saved under a new name.

ProcessTimedOutException on large databases

I get this error message when backing up a large database:

[Symfony\Component\Process\Exception\ProcessTimedOutException]

The process "mysqldump --routines --host='localhost' --port='3306' --user='forge' --password='xxx'
'dbname' >'/home/forge/xxx/app/storage/backups/54419161da73d'" exceeded the timeout of 60 seconds.

I noticed #27, but I still have the problem. I'm using Laravel Forge if that helps.

AwS adapter not found

Hi

I just recently got this error

Class 'League\Flysystem\Adapter\AwsS3' not found in /var/www/html/production/project/app/vendor/heybigname/backup-manager/src/Filesystems/Awss3Filesystem.php on line 34

Standalone examples don't work

Tried using examples, all I got was config expects an array - string given.

Got contents of files as array and got a little further, now have the following error:

Fatal error: Uncaught exception 'BigName\BackupManager\Config\ConfigNotFoundForConnection' with message 'Could not find configuration for connection local' in /Users/iantearle/Sites/TicketGun/vendor/heybigname/backup-manager/src/Config/Config.php:46 Stack trace: #0 /Users/iantearle/Sites/TicketGun/vendor/heybigname/backup-manager/src/Filesystems/FilesystemProvider.php(62): BigName\BackupManager\Config\Config->get('local', 'type') #1 /Users/iantearle/Sites/TicketGun/vendor/heybigname/backup-manager/src/Filesystems/FilesystemProvider.php(44): BigName\BackupManager\Filesystems\FilesystemProvider->getConfig('local', 'type') #2 /Users/iantearle/Sites/TicketGun/vendor/heybigname/backup-manager/src/Procedures/BackupProcedure.php(25): BigName\BackupManager\Filesystems\FilesystemProvider->get('local') #3 /Users/iantearle/Sites/TicketGun/base/backup.php(4): BigName\BackupManager\Procedures\BackupProcedure->run('development', 's3', 'test/backup.sql', 'gzip') #4 {main} thrown in /Users/iantearle/Sites/TicketGun/vendor/heybigname/backup-manager/src/Config/Config.php on line 46

Laravel 5 support

Hello,

just wanted to ask since L5 ->package() has been removed. Are you planing to rewrite laravel service provider to support Laravel 5?

Thanks!

Using "api key" instead "password" in Rackspace Cloud Files

I'm using this package with rackspace and, in the config file I need to put the "password" of an username from my rackspace account.

This is dead dangerous, because rackspace doesn't have a complete role configuration, so this username, with password in plain text, can have access to all my servers.

For that, rackspace has an API Key for each user.

Maybe this will be a "more" correct way.

unlink local file

hello, I get the following error on my server environment when I'm performinc a backup to the local filesystem:

Warning: unlink(/var/www/...../backup/537200d49e701.sql.gz): Text file busy in /var/www/...../vendor/league/flysystem/src/Adapter/Local.php on line 239

the problem in: /var/www/...../vendor/heybigname/backup-manager/src/Commands/Storage

when I replace writeStream and readStream with write and read everything work like expected

public function execute()
    {
        $this->destinationFilesystem->writeStream(
            $this->destinationPath,
            $this->sourceFilesystem->readStream($this->sourcePath)
        );
    }

would this be a solution to the problem?
or can this lead to problems with larger DB dumps? then I have to finde the problem on my server environment. any suggestions?

cheers m@

automatic backup

Anyone has configured an automatic daily backup using this package?

Dropbox upload

Hello,

wanted to ask if there is somehow possible enable overwriting or automatic file name generation.
I want it to daily backup and upload to the dropbox but I would need to each day delete the last day backup or I recieve this error

[League\Flysystem\FileExistsException]
File already exists at path: Backup-mlw

Thanks!

[ErrorException] unlink(/vagrant/laravel/app/storage/backups/53eb70981e319.gz): Text file busy

@mitchellvanw @ShawnMcCool Firstly, I want to say thanks for working on this project, I really appreciate you helping streamline the process here.

I am going to file a new issue for this as this message occurs every time I create a new backup:

[ErrorException]
unlink(/vagrant/laravel/app/storage/backups/53eb70981e319.gz): Text file busy

Please advise on how to fix this please.

Thanks,
Adam

P.S. @ShawnMcCool Any new laravel.io podcasts coming up?

InvalidArgumentException

Hi guys,

I'm getting an error when I try to backup to dropbox:

  [InvalidArgumentException]
  'writeMode' has bad type; expecting Dropbox\WriteMode, got League\Flysystem\Config

I think is a League\Flysystem problem.

thanks

Process fails when you answer NO

Reproduce:

php artisan db:backup --database=production --destination=local --destinationPath=backups/$(date +%Y%m%d%H%M%S) --compression=gzip
Starting backup process...

You've filled in the following answers:
Database: production
Destination: local
Destination Path: /vagrant/www/kac/backups/20140430190750
Compression: gzip

Are these correct? [y/n]

Reply "n" and the process fails.

PHP Fatal error:  Call to undefined method BigName\BackupManager\Integrations\Laravel\DbBackupCommand::askForForgottenArguments()

Add support for encryption

Hi guys,

Would it be possible to add an encryptor that encrypts the compressed package? Might be an idea to add an encryption interface to allow multiple encryption types (openssl/gpg).

I could try to send a PR if this sounds good for you guys, but realistically I won't have time the coming weeks.

Thanks!

Dropbox issue

I am attempting to use Dropbox as my storage. I created the app online and entered the information using your updated Dropbox array on this site (removing token). I am getting:
[InvalidArgumentException]
'accessToken' invalid: can't be empty

Any thoughts? Thanks!

Is Dropbox support actually working?

No matter what I set the root config to be I always get the error:

[2015-02-24 15:59:53] local.ERROR: exception 'LogicException' with message 'The root path / is not writable.' in /home/vagrant/Code/GitHub/scouter/vendor/league/flysystem/src/Adapter/Local.php:37

Rackspace Error

You've filled in the following answers:
Database: production
Destination: rackspace
Destination Path: //2014-06-03_12:16:46.sql
Compression: gzip

Are these correct? [y/n]y
PHP Fatal error: Class 'OpenCloud\OpenStack' not found in /home/vagrant/sites/MiMejorPlan/vendor/heybigname/backup-manager/src/Filesystems/RackspaceFilesystem.php on line 30
PHP Stack trace:
PHP 1. {main}() /home/vagrant/sites/MiMejorPlan/artisan:0
PHP 2. Symfony\Component\Console\Application->run() /home/vagrant/sites/MiMejorPlan/artisan:59
PHP 3. Symfony\Component\Console\Application->doRun() /home/vagrant/sites/MiMejorPlan/vendor/symfony/console/Symfony/Component/Console/Application.php:121
PHP 4. Symfony\Component\Console\Application->doRunCommand() /home/vagrant/sites/MiMejorPlan/vendor/symfony/console/Symfony/Component/Console/Application.php:191
PHP 5. Illuminate\Console\Command->run() /home/vagrant/sites/MiMejorPlan/vendor/symfony/console/Symfony/Component/Console/Application.php:885
PHP 6. Symfony\Component\Console\Command\Command->run() /home/vagrant/sites/MiMejorPlan/vendor/laravel/framework/src/Illuminate/Console/Command.php:96
PHP 7. Illuminate\Console\Command->execute() /home/vagrant/sites/MiMejorPlan/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:241
PHP 8. BigName\BackupManager\Integrations\Laravel\DbBackupCommand->fire() /home/vagrant/sites/MiMejorPlan/vendor/laravel/framework/src/Illuminate/Console/Command.php:108
PHP 9. BigName\BackupManager\Procedures\BackupProcedure->run() /home/vagrant/sites/MiMejorPlan/vendor/heybigname/backup-manager/src/Integrations/Laravel/DbBackupCommand.php:94
PHP 10. BigName\BackupManager\Filesystems\FilesystemProvider->get() /home/vagrant/sites/MiMejorPlan/vendor/heybigname/backup-manager/src/Procedures/BackupProcedure.php:55
PHP 11. BigName\BackupManager\Filesystems\RackspaceFilesystem->get() /home/vagrant/sites/MiMejorPlan/vendor/heybigname/backup-manager/src/Filesystems/FilesystemProvider.php:47
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'OpenCloud\OpenStack' not found","file":"/home/vagrant/sites/MiMejorPlan/vendor/heybigname/backup-manager/src/Filesystems/RackspaceFilesystem.php","line":30}}vagrant@homestead:~/sites/MiMejorPlan$

db:restore command does not actually restore database

Running the db:restore command, pulling from AWS S3 to pgsql, using gzip compression, I get the following message:

Successfully restored /production-backup-2014-12-12 13:00:02.gz from s3 to database pgsql.

Checking my database afterwards, I can confirm that the data has not been restored. I am in my local environment, and using getenv('APP_ENV') in config/local/database.php to specify the environment, as well as db password and username. These are all set up correctly, since my application is running without any issue.

Am I misunderstanding the function of the db:restore command? I believed it would overwrite my database with the sql dump. I can also confirm that the sql dump at /production-backup-2014-12-12 13:00:02.gz is correct and valid. The db:backup command works fine.

Psql dump asks for password interactively

Having the following setup, the password field in configuration is not used and the fe_sendauth asks for password interactively.

protected function execute(InputInterface $input, OutputInterface $output)
{
    $file = $input->getArgument('file') . '.sql';
    $this->getManager()->makeBackup()->run('stage', 'local', $file, 'gzip');

    $output->writeln("<info>Databased backed up to '$file.gz'</info>");
}

/**
 * @return Manager
 */
protected function getManager()
{
    /** @see https://github.com/heybigname/backup-manager#quick-and-dirty */
    $storage = new Config([
        'local' => [
            'type' => 'Local',
            'root' => $this->container->parameters['appDir'] . '/..',
        ],
    ]);
    $filesystems = new Filesystems\FilesystemProvider($storage);
    $filesystems->add(new Filesystems\Awss3Filesystem);
    $filesystems->add(new Filesystems\DropboxFilesystem);
    $filesystems->add(new Filesystems\FtpFilesystem);
    $filesystems->add(new Filesystems\LocalFilesystem);
    $filesystems->add(new Filesystems\RackspaceFilesystem);
    $filesystems->add(new Filesystems\SftpFilesystem);

    $p = $this->container->parameters['database'];
    $db = new Config([
        'stage' => [
            'type' => 'postgresql',
            'host' => 'localhost',
            'user' => 'postgres',
            'pass' => 123,
            'database' => 'khanovaskola',
        ]
    ]);

    $databases = new Databases\DatabaseProvider($db);
    $databases->add(new Databases\MysqlDatabase);
    $databases->add(new Databases\PostgresqlDatabase);

    $compressors = new Compressors\CompressorProvider;
    $compressors->add(new Compressors\GzipCompressor);
    $compressors->add(new Compressors\NullCompressor);

    return new Manager($filesystems, $databases, $compressors);
}

Laravel 4.2 error

Hi

I get the following error trying to use backup-manager and Laravel 4.2

Access level to BigName\BackupManager\Integrations\Laravel\BaseCommand::table() must be public

Full error from the terminal gere.

{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Access level to BigName\BackupManager\Integrations\Laravel\BaseCommand::table() must be public (as in class Illuminate\Console\Command)","file":"/Users/johannes.fosseus/Documents/vagrants/poetfreak/vendor/heybigname/backup-manager/src/Integrations/Laravel/BaseCommand.php","line":46}}

Script php artisan clear-compiled handling the post-update-cmd event returned with an error

BR // johannes

Class 'League\Flysystem\Dropbox\DropboxAdapter not found

Hi, I updated to the latest version (0.3.10) and now I get this error:

PHP Fatal error: Class 'League\Flysystem\Dropbox\DropboxAdapter' not found in /home/forge/default/vendor/heybigname/backup-manager/src/Filesystems/DropboxFilesystem.php on line 30

maybe this has something to do with the changed dependencies?
v0.3.9 => league/flysystem: >=0.3.1
v0.3.10 => league/flysystem: ~1.0

*edit:
I just tested It and it is indead due to the dependencies.
I installed league/flysystem v0.5.12 and heybigname/backup-manager v0.3.9 and the dropbox backup works fine now

Allow users to change s3 base_url

The Amazon AWS s3 API is used by DreamObjects (http://www.dreamhost.com/cloud/dreamobjects/), and all that's required is changing the base_url setting during the initialization. I'm not familiar with git to do a pull request, but the only required changes are:

In \config\storage.php, add:
'base_url' => '',
to the s3 array. If it's left null, it will default to Amazon.

And in BigName\BackupManager\Filesystems\Awss3Filesystem.php, add:
'base_url' => $config['base_url'],
to ~line 32.

Backup MySQL using percona xtrabackup

Percona Xtrabackup allows to do consistent, non-blocking, incremental backups of InnoDB databases (and MyISAM, in a blocking way). Backups are also faster to restore, since the output of Xtrabackup is the content of MySQL's data directory. It's free (as beer and speech).

Allowing to use xtrabackup instead of mysqldump would allow to do faster backup, restore, and use less storage when multiple versions of a backup are kept.

Composer package suggestions

Not a major one, but is it necessary to have filesystem related suggestions in the composer.json? IMO it is enough that flysystem suggests those packages. Basically flysystem can use them not backupmanager.

Suggestion: Google Drive

Would it be worth having google drive as an option?

Excellent infrastructure, and their apps accounts are now offering much bigger space and encrypts all data too. (so i've read)

Cannot decompress backup file

Hi,

When trying to restore a backup from Amazon S3, I get the following error in the terminal:

gzip: app/storage/temp/local.backup.latest.sql.gz.sql: unknown suffix -- ignored

In my S3 bucket that file is named local.backup.latest.sql.gz. For some reason the downloaded backup file has an extra .sql extension added, which means the gunzip command fails as it doesn't recognise the extension.

I've had a look to see where that extra .sql might be coming from but couldn't find anything. Any ideas?

Could not find configuration for connection

Hi

Have been using this great code for a while but suddenly I have this error, and the backups fail?

[BigName\BackupManager\Config\ConfigNotFoundForConnection]
Could not find configuration for connection local-sitename

[ 'type' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'user' => 'root', 'pass' => 'secret', 'database' => 'mydatabase', ], ]; $now = strftime("%Y_%m_%d", strtotime("now")); $manager = App::make('BigName\BackupManager\Manager'); $manager->makeBackup()->run( 'local-sitename', 'local', $now.'_mybck.sql', 'gzip' ); Trying to run this from my terminal php artisan nightly --env=local-sitename

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.