PHPackages                             dbrisinajumi/dbbackup - 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. dbrisinajumi/dbbackup

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

dbrisinajumi/dbbackup
=====================

Sheduled MySQL database backups

044PHP

Since Apr 15Pushed 4y ago5 watchersCompare

[ Source](https://github.com/DBRisinajumi/db-backup)[ Packagist](https://packagist.org/packages/dbrisinajumi/dbbackup)[ RSS](/packages/dbrisinajumi-dbbackup/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

\##Install

Add the repository to composer.json

```
    "repositories": [
    {
      "type": "git",
      "url": "https://github.com/DBRisinajumi/db-backup.git"
    }
  ],
```

Add to require section

```
"require": {
   "dbrisinajumi/dbbackup": "dev-master"
},
```

\##Database dumper

### Usage via Yii2 console command and .env

[](#usage-via-yii2-console-command-and-env)

Set the DB access variables in .env file

```
DB_ENV_MYSQL_DATABASE=dbname
DB_ENV_MYSQL_USER=dbname_php
DB_ENV_MYSQL_PASSWORD=secret
BACKUP_DUMP_FILE_NAME_FORMAT=weekday-number

//Optional - set dumper engine to mydumper instead default mysqldump
BACKUP_DUMP_ENGINE=mydumper
```

Add the controller to config/console.php

```
'controllerMap' => [
        'backup' => [
            'class' => 'DbBackup\controllers\yii2\BackupController',
        ],
```

Example cron command

```
0 4 * * *  /usr/bin/php [SITE PATH]/yii backup/dump -i=daily >> [SITE PATH]/vendor/dbrisinajumi/dbbackup/runtime/log/db-dump-daily.log 2>&1
```

### Usage via custom script

[](#usage-via-custom-script)

```
use DbBackup\Dumper;

// include your own config files with access constants and autoload;
require dirname(__FILE__, 2) . '/config.inc';
require CMS_VENDOR_PATH . 'autoload.php';

// Run the Dumper with necessary params
$dumper = new Dumper(
    [
        'dbUser' => CMS_DBUSER,               // Database user
        'dbPassword' => CMS_DBPASS,           // Database password
        'dbName' => CMS_DBASE,                // Database name
        'dbHost' => CMS_DBSERVER,             // Database host
        'interval' => Dumper::INTERVAL_DAILY, // Interval name (used for dump file and backup folder naming)
        'cronPath' => __FILE__,               // Path for cron (used for generated cron command example)

        // Optional params
        'dumpFileName' => Dumper::FILE_NAME_WEEKDAY_NUMBER, // Set the dump file names to rewritable (weekday numbers like 1.sql, 2.sql) to reduce disk space
        'dumperApp' => parent::DUMPER_MYDUMPER,             // Set mydumper as alternative (may not work correctly yet)
    ]
);
echo $dumper->run();
```

Upload Backups to remote server
-------------------------------

[](#upload-backups-to-remote-server)

### Usage via Yii2 console command and .env

[](#usage-via-yii2-console-command-and-env-1)

Set the backup server access variables in .env file

```
BACKUP_DUMP_FILE_NAME_FORMAT = weekday-number
BACKUP_SERVER_HOST=backups.example.com
BACKUP_SERVER_USERNAME=backupuser
BACKUP_SERVER_PASSWORD=secretpassword
BACKUP_SERVER_PATH=my.website.com
```

Add the controller to config/console.php

```
'controllerMap' => [
        'backup' => [
            'class' => 'DbBackup\controllers\yii2\BackupController',
        ],
```

Example cron command

```
0 4 * * *  /usr/bin/php [SITE PATH]/yii backup/sync -i=daily >> [SITE PATH]/vendor/dbrisinajumi/dbbackup/runtime/log/backup-sync-daily.log 2>&1
```

### Usage via custom script

[](#usage-via-custom-script-1)

```
use DbBackup\Sync;

// include your own config files with access constants and autoload;
require dirname(__FILE__, 2) . '/config.inc';
require CMS_VENDOR_PATH . 'autoload.php';

$sync = new Sync([
    'host' => BACKUP_SERVER_HOST,
    'user' => BACKUP_SERVER_USERNAME,
    'password' => BACKUP_SERVER_PASSWORD,
    'remotePath' => BACKUP_SERVER_PATH,
    'cronPath' => __FILE__,
]);
echo $sync->run();
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/542187ba859514d10d0952dca77df8ea889a9651b249d0b5b513da791fd2919b?d=identicon)[uldisn](/maintainers/uldisn)

---

Top Contributors

[![anothersoftware-lv](https://avatars.githubusercontent.com/u/9327511?v=4)](https://github.com/anothersoftware-lv "anothersoftware-lv (28 commits)")

### Embed Badge

![Health badge](/badges/dbrisinajumi-dbbackup/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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