PHPackages                             s4studio/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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. s4studio/yii2-db-manager

ActiveYii2-extension[Debugging &amp; Profiling](/categories/debugging)

s4studio/yii2-db-manager
========================

The db dump manager module for Yii2

2.6.0(1y ago)0196BSD-3-ClausePHP

Since Jun 4Pushed 1y agoCompare

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

READMEChangelog (4)Dependencies (5)Versions (16)Used By (0)

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

[](#yii2-db-manager)

Click on a ⭐!

[![Total Downloads](https://camo.githubusercontent.com/122f3a529d2ff3f1316021bbf8a889db6cc16425081012379a63ac75ec5a56f9/68747470733a2f2f706f7365722e707567782e6f72672f733473747564696f2f796969322d64622d6d616e616765722f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/s4studio/yii2-db-manager)[![Latest Stable Version](https://camo.githubusercontent.com/10a9ad062897b49ed5876c97324805c434b560bdfd2898d7dca814d3c205b237/68747470733a2f2f706f7365722e707567782e6f72672f733473747564696f2f796969322d64622d6d616e616765722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/s4studio/yii2-db-manager)[![Latest Unstable Version](https://camo.githubusercontent.com/cfa2f2ac359ad5074b8e6ed6d80a14fc176cb3506215746261848996d2831fb7/68747470733a2f2f706f7365722e707567782e6f72672f733473747564696f2f796969322d64622d6d616e616765722f762f756e737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/s4studio/yii2-db-manager)[![License](https://camo.githubusercontent.com/26b943979aa14b78ab5af33155c63c5bfca1b1f2137a91e2ccce005f553e3b2a/68747470733a2f2f706f7365722e707567782e6f72672f733473747564696f2f796969322d64622d6d616e616765722f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/s4studio/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 s4studio/yii2-db-manager "*"
```

or add

```
"s4studio/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' => 's4studio\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' => 's4studio\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' => 's4studio\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

37

—

LowBetter than 83% of packages

Maintenance42

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 60.9% 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 ~225 days

Recently: every ~499 days

Total

15

Last Release

475d ago

Major Versions

1.0.3 → 2.0.02017-07-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/1bb0203a0513468d82ada30651fe5a49e4ed2a11276652e6e9e63636144d873c?d=identicon)[ekawalec](/maintainers/ekawalec)

---

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)")[![ekawalec](https://avatars.githubusercontent.com/u/9531269?v=4)](https://github.com/ekawalec "ekawalec (9 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

backupdumpyii2db manager

### Embed Badge

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

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

###  Alternatives

[beaten-sect0r/yii2-db-manager

The db dump manager module for Yii2

9344.1k1](/packages/beaten-sect0r-yii2-db-manager)[demi/backup

Basic Yii2 site backup methods

2020.8k](/packages/demi-backup)

PHPackages © 2026

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