PHPackages                             beaten-sect0r/yii2-db-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. beaten-sect0r/yii2-db-manager

ActiveYii2-extension[Database &amp; ORM](/categories/database)

beaten-sect0r/yii2-db-manager
=============================

The db dump manager module for Yii2

2.2.2(6y ago)9344.1k—8.3%32[9 issues](https://github.com/Beaten-Sect0r/yii2-db-manager/issues)1BSD-3-ClausePHPCI failing

Since Jun 4Pushed 4y ago8 watchersCompare

[ Source](https://github.com/Beaten-Sect0r/yii2-db-manager)[ Packagist](https://packagist.org/packages/beaten-sect0r/yii2-db-manager)[ RSS](/packages/beaten-sect0r-yii2-db-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (12)Used By (1)

Yii2 DB manager
===============

[](#yii2-db-manager)

Click on a ⭐!

[![Total Downloads](https://camo.githubusercontent.com/e292c994c547bed2f47ad9ae0f179dbc0c3fbf3d5b65f4730492651539fa5bd9/68747470733a2f2f706f7365722e707567782e6f72672f62656174656e2d7365637430722f796969322d64622d6d616e616765722f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/beaten-sect0r/yii2-db-manager)[![Latest Stable Version](https://camo.githubusercontent.com/11c53894d7c43e4b4e042e9ac5a083f438ae475bcddc9e6fb8383582af7c7787/68747470733a2f2f706f7365722e707567782e6f72672f62656174656e2d7365637430722f796969322d64622d6d616e616765722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/beaten-sect0r/yii2-db-manager)[![Latest Unstable Version](https://camo.githubusercontent.com/1da75b4c6804b7629b4334e31e3689655f3724550f70a21de72e7acd3e64f419/68747470733a2f2f706f7365722e707567782e6f72672f62656174656e2d7365637430722f796969322d64622d6d616e616765722f762f756e737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/beaten-sect0r/yii2-db-manager)[![License](https://camo.githubusercontent.com/1842da6318072825ab62b4df0f46e1fa260eef6f27332b02e0a266379864560f/68747470733a2f2f706f7365722e707567782e6f72672f62656174656e2d7365637430722f796969322d64622d6d616e616765722f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/beaten-sect0r/yii2-db-manager)

MySQL/PostgreSQL Database Backup and Restore functionality

[![screenshot](screenshot.png)](screenshot.png)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require --prefer-dist beaten-sect0r/yii2-db-manager "*"
```

or add

```
"beaten-sect0r/yii2-db-manager": "*"

```

to the require section of your `composer.json` file.

Configuration
-------------

[](#configuration)

Once the extension is installed, simply add it in your config by:

Basic `config/web.php`

Advanced `backend/config/main.php`

Simple config
-------------

[](#simple-config)

```
    'modules' => [
        'db-manager' => [
            'class' => 'bs\dbManager\Module',
            // path to directory for the dumps
            'path' => '@app/backups',
            // list of registerd db-components
            'dbList' => ['db'],
            // Flysystem adapter (optional) creocoder\flysystem\LocalFilesystem will be used as default.
            'flySystemDriver' => 'creocoder\flysystem\LocalFilesystem',
            'as access' => [
                'class' => 'yii\filters\AccessControl',
                'rules' => [
                    [
                        'allow' => true,
                        'roles' => ['admin'],
                    ],
                ],
            ],
        ],
    ],
```

Advanced config
---------------

[](#advanced-config)

```
    'components' => [
        // https://github.com/creocoder/yii2-flysystem
        'backupStorage' => [
            'class' => 'creocoder\flysystem\FtpFilesystem',
            'host' => 'ftp.example.com',
            //'port' => 21,
            //'username' => 'your-username',
            //'password' => 'your-password',
            //'ssl' => true,
            //'timeout' => 60,
            //'root' => '/path/to/root',
            //'permPrivate' => 0700,
            //'permPublic' => 0744,
            //'passive' => false,
            //'transferMode' => FTP_TEXT,
        ],
    ],
    'modules' => [
        'db-manager' => [
            'class' => 'bs\dbManager\Module',
            // Flysystem adapter (optional) creocoder\flysystem\LocalFilesystem will be used as default.
            'flySystemDriver' => 'creocoder\flysystem\LocalFilesystem',
            // path to directory for the dumps
            'path' => '@app/backups',
            // list of registerd db-components
            'dbList' => ['db', 'db1', 'db2'],
            // process timeout
            'timeout' => 3600,
            // additional mysqldump/pg_dump presets (available for choosing in dump and restore forms)
            'customDumpOptions' => [
                'mysqlForce' => '--force',
                'somepreset' => '--triggers --single-transaction',
                'pgCompress' => '-Z2 -Fc',
            ],
            'customRestoreOptions' => [
                'mysqlForce' => '--force',
                'pgForce' => '-f -d',
            ],
            // options for full customizing default command generation
            'mysqlManagerClass' => 'CustomClass',
            'postgresManagerClass' => 'CustomClass',
            // option for add additional DumpManagers
            'createManagerCallback' => function($dbInfo) {
                if ($dbInfo['dbName'] == 'exclusive') {
                    return new MyExclusiveManager;
                } else {
                    return false;
                }
            }
            'as access' => [
                'class' => 'yii\filters\AccessControl',
                'rules' => [
                    [
                        'allow' => true,
                        'roles' => ['admin'],
                    ],
                ],
            ],
        ],
    ],
```

Console config
--------------

[](#console-config)

```
    'modules' => [
        'db-manager' => [
            'class' => 'bs\dbManager\Module',
            // Flysystem adapter (optional) creocoder\flysystem\LocalFilesystem will be used as default.
            'flySystemDriver' => 'creocoder\flysystem\LocalFilesystem',
            // path to directory for the dumps
            'path' => '@app/backups',
            // list of registerd db-components
            'dbList' => ['db'],
        ],
    ],
```

Make sure you create a writable directory named backup on app root directory.

Usage
-----

[](#usage)

Pretty url's `/db-manager`

No pretty url's `index.php?r=db-manager`

Console usage
-------------

[](#console-usage)

`-db` - db component, default value: `db`

`-gz` - gzip archive

`-s` - file storage

`-f` - file name, default last dump

Create dump

```
php yii dump/create -db=db -gz -s
```

Restore dump

```
php yii dump/restore -db=db -s -f=dump.sql
```

Deleting all dumps

```
php yii dump/delete-all
```

Test database connection

```
php yii dump/test-connection -db=db
```

Changelog
---------

[](#changelog)

- [Flysystem support](https://github.com/creocoder/yii2-flysystem)
- Console support
- Multiple database management
- Ability for customize dump and restore options; dump and restore processors
- Ability for run operations asynchronously
- Ability for compressing dumps

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 66% 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 ~116 days

Total

11

Last Release

2471d ago

Major Versions

1.0.3 → 2.0.02017-07-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd8595ce7623e9dd2ddff8d32c6d6ee289ce53aff5219bbd69c52303f361f3fe?d=identicon)[Beaten\_Sect0r](/maintainers/Beaten_Sect0r)

---

Top Contributors

[![Beaten-Sect0r](https://avatars.githubusercontent.com/u/1025052?v=4)](https://github.com/Beaten-Sect0r "Beaten-Sect0r (70 commits)")[![Insolita](https://avatars.githubusercontent.com/u/1847402?v=4)](https://github.com/Insolita "Insolita (21 commits)")[![ignatenkovnikita](https://avatars.githubusercontent.com/u/4436320?v=4)](https://github.com/ignatenkovnikita "ignatenkovnikita (7 commits)")[![Spell6inder](https://avatars.githubusercontent.com/u/2795910?v=4)](https://github.com/Spell6inder "Spell6inder (4 commits)")[![huiyang](https://avatars.githubusercontent.com/u/517651?v=4)](https://github.com/huiyang "huiyang (1 commits)")[![gogl92](https://avatars.githubusercontent.com/u/1505641?v=4)](https://github.com/gogl92 "gogl92 (1 commits)")[![kwazaro](https://avatars.githubusercontent.com/u/9011218?v=4)](https://github.com/kwazaro "kwazaro (1 commits)")[![nick-denry](https://avatars.githubusercontent.com/u/1450983?v=4)](https://github.com/nick-denry "nick-denry (1 commits)")

---

Tags

backupdatabasedumpyii2backupdumpyii2db manager

### Embed Badge

![Health badge](/badges/beaten-sect0r-yii2-db-manager/health.svg)

```
[![Health](https://phpackages.com/badges/beaten-sect0r-yii2-db-manager/health.svg)](https://phpackages.com/packages/beaten-sect0r-yii2-db-manager)
```

###  Alternatives

[spatie/db-dumper

Dump databases

1.2k25.9M69](/packages/spatie-db-dumper)[rah/danpu

Zero-dependency MySQL dump library for easily exporting and importing databases

64401.8k10](/packages/rah-danpu)[cornford/backup

An easy way backup and restore databases in Laravel.

4225.6k](/packages/cornford-backup)[spanjeta/yii2-backup

Database Backup and Restore functionality

285.0k1](/packages/spanjeta-yii2-backup)[yiier/yii2-backup

Database Backup and Restore functionality

262.8k1](/packages/yiier-yii2-backup)

PHPackages © 2026

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