PHPackages                             backup-manager/backup-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. backup-manager/backup-manager

ActiveLibrary[Database &amp; ORM](/categories/database)

backup-manager/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.

3.1.0(3y ago)1.7k1.5M—2.3%224[8 issues](https://github.com/backup-manager/backup-manager/issues)[7 PRs](https://github.com/backup-manager/backup-manager/pulls)11MITPHPPHP ^7.4 || ^8.0

Since Apr 16Pushed 1y ago53 watchersCompare

[ Source](https://github.com/backup-manager/backup-manager)[ Packagist](https://packagist.org/packages/backup-manager/backup-manager)[ RSS](/packages/backup-manager-backup-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (11)Versions (48)Used By (11)

Database Backup Manager
=======================

[](#database-backup-manager)

[![Packagist Version](https://camo.githubusercontent.com/f5d580ebaa8acc1c43b1973c1a9a98e37c19023c17d832d2f88e1743877b0bfe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6261636b75702d6d616e616765722f6261636b75702d6d616e61676572)](https://camo.githubusercontent.com/f5d580ebaa8acc1c43b1973c1a9a98e37c19023c17d832d2f88e1743877b0bfe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6261636b75702d6d616e616765722f6261636b75702d6d616e61676572)[![Packagist License](https://camo.githubusercontent.com/94879fe825c23de53233e37e1c3036272dfae8902f35f0d68de1de31195bbf45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6261636b75702d6d616e616765722f6261636b75702d6d616e61676572)](https://camo.githubusercontent.com/94879fe825c23de53233e37e1c3036272dfae8902f35f0d68de1de31195bbf45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6261636b75702d6d616e616765722f6261636b75702d6d616e61676572)[![Installs](https://camo.githubusercontent.com/1ad85d290a989c2db8670374a42c1f14a3416f3babcdfdb0022217a8dae164e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6261636b75702d6d616e616765722f6261636b75702d6d616e61676572)](https://camo.githubusercontent.com/1ad85d290a989c2db8670374a42c1f14a3416f3babcdfdb0022217a8dae164e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6261636b75702d6d616e616765722f6261636b75702d6d616e61676572)

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 &gt;=PHP 7.3
- use version 1 for &lt;PHP 7.2

[Watch a video tour](https://www.youtube.com/watch?v=vWXy0R8OavM) showing the Laravel driver in action to give you an idea what is possible.

- supports `MySQL` and `PostgreSQL`
- compress with `Gzip`
- framework-agnostic
- dead simple configuration
- [Laravel Driver](http://github.com/backup-manager/laravel)
- [Symfony Driver](http://github.com/backup-manager/symfony)

### Table of Contents

[](#table-of-contents)

- [Database Backup Manager](#database-backup-manager)
    - [Table of Contents](#table-of-contents)
    - [Quick and Dirty](#quick-and-dirty)
    - [Requirements](#requirements)
    - [Installation](#installation)
    - [Usage](#usage)
    - [Contribution Guidelines](#contribution-guidelines)
    - [Maintainers](#maintainers)
    - [Backwards Compatibility Breaks](#backwards-compatibility-breaks)
    - [License](#license)

### Quick and Dirty

[](#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

[](#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

[](#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

[](#usage)

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

We've provided a native PHP example [here](https://github.com/backup-manager/backup-manager/tree/master/examples).

The required bootstrapping can [be found in the example here](https://github.com/backup-manager/backup-manager/blob/master/examples/standalone/bootstrap.php).

### Contribution Guidelines

[](#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](https://github.com/backup-manager/backup-manager/issues/new) to ensure compatibility with the project's goals.

### Maintainers

[](#maintainers)

This package is maintained by [Shawn McCool](http://shawnmc.cool) and you!

### Backwards Compatibility Breaks

[](#backwards-compatibility-breaks)

#### 3.0

[](#30)

Remove support for symfony 2. Specifically symfony/process versions &lt; 3.x

### License

[](#license)

This package is licensed under the [MIT license](https://github.com/backup-manager/backup-manager/blob/master/LICENSE). Go wild.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity65

Solid adoption and visibility

Community45

Growing community involvement

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 59.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~68 days

Recently: every ~238 days

Total

45

Last Release

1413d ago

Major Versions

0.3.10 → 1.0.02015-06-16

1.1.1 → 2.0.x-dev2016-02-08

1.4.1 → 2.02019-11-22

2.1.0 → 3.02020-02-16

PHP version history (7 changes)0.1PHP &gt;=5.4.0

1.0.8PHP &gt;=5.5.9

2.0.x-devPHP &gt;=5.6

1.2PHP ^5.5.9 || ^7.0

1.4PHP &gt;=7.1

2.0.1PHP &gt;=7.3

3.1.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

![](https://www.gravatar.com/avatar/6da00bb361f9beaa0dbd9577dd2b3c35089dd5d6ae9a3b57003d09f7737739b0?d=identicon)[ShawnMcCool](/maintainers/ShawnMcCool)

---

Top Contributors

[![mitchellvanw](https://avatars.githubusercontent.com/u/3061428?v=4)](https://github.com/mitchellvanw "mitchellvanw (117 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (18 commits)")[![cklm](https://avatars.githubusercontent.com/u/466021?v=4)](https://github.com/cklm "cklm (8 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (6 commits)")[![bcalik](https://avatars.githubusercontent.com/u/9222368?v=4)](https://github.com/bcalik "bcalik (4 commits)")[![GizzmoShifu](https://avatars.githubusercontent.com/u/1200724?v=4)](https://github.com/GizzmoShifu "GizzmoShifu (4 commits)")[![driesvints](https://avatars.githubusercontent.com/u/594614?v=4)](https://github.com/driesvints "driesvints (4 commits)")[![hason](https://avatars.githubusercontent.com/u/288535?v=4)](https://github.com/hason "hason (3 commits)")[![vanodevium](https://avatars.githubusercontent.com/u/16780069?v=4)](https://github.com/vanodevium "vanodevium (3 commits)")[![Ali1](https://avatars.githubusercontent.com/u/218558?v=4)](https://github.com/Ali1 "Ali1 (2 commits)")[![benbridts](https://avatars.githubusercontent.com/u/1301221?v=4)](https://github.com/benbridts "benbridts (2 commits)")[![benr77](https://avatars.githubusercontent.com/u/2156742?v=4)](https://github.com/benr77 "benr77 (2 commits)")[![chromeorfirefox](https://avatars.githubusercontent.com/u/10752650?v=4)](https://github.com/chromeorfirefox "chromeorfirefox (2 commits)")[![godeg123](https://avatars.githubusercontent.com/u/12759680?v=4)](https://github.com/godeg123 "godeg123 (2 commits)")[![lucasff](https://avatars.githubusercontent.com/u/4260591?v=4)](https://github.com/lucasff "lucasff (2 commits)")[![ShawnMcCool](https://avatars.githubusercontent.com/u/560749?v=4)](https://github.com/ShawnMcCool "ShawnMcCool (2 commits)")[![Shotman](https://avatars.githubusercontent.com/u/6579166?v=4)](https://github.com/Shotman "Shotman (2 commits)")[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (2 commits)")[![bberlijn](https://avatars.githubusercontent.com/u/9305845?v=4)](https://github.com/bberlijn "bberlijn (1 commits)")[![MeRoBo](https://avatars.githubusercontent.com/u/51643407?v=4)](https://github.com/MeRoBo "MeRoBo (1 commits)")

---

Tags

backupbackup-managerclouddatabaseframework-agnosticlaravelmysqlphppostgresqlrestoresymfony

### Embed Badge

![Health badge](/badges/backup-manager-backup-manager/health.svg)

```
[![Health](https://phpackages.com/badges/backup-manager-backup-manager/health.svg)](https://phpackages.com/packages/backup-manager-backup-manager)
```

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[spatie/db-dumper

Dump databases

1.2k25.9M69](/packages/spatie-db-dumper)[spatie/laravel-db-snapshots

Quickly dump and load databases

1.2k2.8M20](/packages/spatie-laravel-db-snapshots)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2592.8M263](/packages/ssch-typo3-rector)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
