All Projects → Beaten-Sect0r → yii2-db-manager

Beaten-Sect0r / yii2-db-manager

Licence: BSD-3-Clause License
Database Backup and Restore functionality

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to yii2-db-manager

Backup
MySQL Database backup package for Laravel
Stars: ✭ 66 (-31.25%)
Mutual labels:  backup, dump
Clickhouse Backup
Tool for easy ClickHouse backup and restore with cloud storages support
Stars: ✭ 359 (+273.96%)
Mutual labels:  backup, dump
mysql-backup-golang
Mysql backup golang
Stars: ✭ 25 (-73.96%)
Mutual labels:  backup, dump
Wikiteam
Tools for downloading and preserving wikis. We archive wikis, from Wikipedia to tiniest wikis. As of 2020, WikiTeam has preserved more than 250,000 wikis.
Stars: ✭ 404 (+320.83%)
Mutual labels:  backup, dump
Telegram Cli Backup
A simple Lua script to backup Telegram messages into a CSV or sqlite database
Stars: ✭ 101 (+5.21%)
Mutual labels:  backup, dump
Dumpling
Dumpling is a fast, easy-to-use tool written by Go for dumping data from the database(MySQL, TiDB...) to local/cloud(S3, GCP...) in multifarious formats(SQL, CSV...).
Stars: ✭ 134 (+39.58%)
Mutual labels:  backup, dump
laravel-database-manager
Make your database simple, easier and faster with vuejs.
Stars: ✭ 50 (-47.92%)
Mutual labels:  backup, dump
Yii2-Youtube-Clone
Youtube clone made with Yii2 framework
Stars: ✭ 91 (-5.21%)
Mutual labels:  yii2
yii2-websocket
基于swoole的websocket
Stars: ✭ 31 (-67.71%)
Mutual labels:  yii2
docker-aws-s3-sync
Docker container to sync a folder to Amazon S3
Stars: ✭ 21 (-78.12%)
Mutual labels:  backup
docker-atlassian
A docker-compose orchestration for JIRA Software and Confluence based on docker containers.
Stars: ✭ 13 (-86.46%)
Mutual labels:  backup
yii2-rest-doc
Yii2 REST doc generator
Stars: ✭ 35 (-63.54%)
Mutual labels:  yii2
gitlab-mattermost-backup
A simple backup script for mattermost in gitlab omnibus package
Stars: ✭ 23 (-76.04%)
Mutual labels:  backup
grafana
Grafana dashboard for Veeam solutions
Stars: ✭ 31 (-67.71%)
Mutual labels:  backup
kube-dump
Backup a Kubernetes cluster as a yaml manifest
Stars: ✭ 142 (+47.92%)
Mutual labels:  backup
restique
A wrapper around restic with profiles
Stars: ✭ 43 (-55.21%)
Mutual labels:  backup
eXperDB-Management
eXperDB-Management is a integrated management tool for PostgreSQL(for efficient operation and management).
Stars: ✭ 38 (-60.42%)
Mutual labels:  backup
pingcrm-yii2
Ping CRM on Yii 2 - A Yii 2 demo application to illustrate how Inertia.js works.
Stars: ✭ 39 (-59.37%)
Mutual labels:  yii2
awesome-backup
A list of FOSS backup software
Stars: ✭ 55 (-42.71%)
Mutual labels:  backup
docker-backup
💾 Docker container for incremental backups based on alpine (S3, Google Cloud Storage, FTP, SFTP, SCP, rsync, file...)
Stars: ✭ 19 (-80.21%)
Mutual labels:  backup

Yii2 DB manager

Click on a !

Total Downloads Latest Stable Version Latest Unstable Version License

MySQL/PostgreSQL Database Backup and Restore functionality

screenshot

Installation

The preferred way to install this extension is through composer.

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

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

Basic config/web.php

Advanced backend/config/main.php

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

    '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

    '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

Pretty url's /db-manager

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

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

  • Flysystem support
  • 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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].