当前位置: 首页 > 软件库 > 数据库相关 > >

backup-manager

授权协议 MIT License
开发语言 PHP
所属分类 数据库相关
软件类型 开源软件
地区 不详
投 递 者 强化
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Database Backup Manager

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 >=PHP 7.3
  • use version 1 for <PHP 7.2

Watch a video tour showing the Laravel driver in action to give you an idea what is possible.

Table of Contents

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

  • 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

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

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

We've provided a native PHP example here.

The required bootstrapping can be found in the example here.

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 to ensure compatibility with the project's goals.

Maintainers

This package is maintained by Shawn McCool and you!

Backwards Compatibility Breaks

3.0

Remove support for symfony 2. Specifically symfony/process versions < 3.x

License

This package is licensed under the MIT license. Go wild.

  • centos 7报错如下------------------- There are no enabled repos.  Run "yum repolist all" to see the repos you have.  To enable Red Hat Subscription Management repositories:      subscription-manager repos

  • 一、报错信息 当利用yum安装软件时,会产生下面产生的错误时,错误代码如下所示: Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile There are no enabled repos. Run “yum repolist all” to see the repos you hav

 相关资料
  • Backup This project is welcoming new contributors and maintainers. See CONTRIBUTING.md Backup is a system utility for Linux and Mac OS X, distributed as a RubyGem, that allows you to easily perform ba

  • Areca Backup 是一个用Java编写的个人文件备份工具,支持压缩、打包、加密等操作。

  • Borg 是一个支持去重和压缩的备份程序,同时也支持认证加密。其主要目的是提供一个高校而且安全的方法用于数据备份。数据的去重技术用于每日增量备份。 使用方法: $ borg init /mnt/backup$ borg create /mnt/backup::Monday ~/Documents$ borg create --stats /mnt/backup::Tuesday ~/Documen

  • backup-utils 是 Github 企业备份工具,它包括一些备份和恢复工具。这些备份工具实现了多项用于备份主机的高级功能,还原功能也已经包括在 GitHub Enterprise 中。 特性: 通过两个简单的实用工具来完善GitHub Enterprise Server备份和恢复系统: ghe-backup和ghe-restore。 联机备份。在备份运行期间,无需将GitHub设备置于维护

  • Kiwi Backup 是一个在线备份系统(非开源),可以通过ADSL网络处理超过200G的数据,通过块提升和无重复的数据算法来降低网络带宽需求,可以通过SSL传输层进行数据传输。

  • MCM Backup 是一个用来备份 PHP 网站和MySQL 数据库的软件。.