定制 andreas-a/backup-database-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andreas-a/backup-database-bundle

最新稳定版本:1.0.2

Composer 安装命令:

composer require andreas-a/backup-database-bundle

包简介

A Symfony bundle that provides a command to easily backup databases.

README 文档

README

This bundle is not maintained anymore!

General

A Symfony bundle that provides a command to easily backup databases.

Note: For now only MySQL is supported. It should also support MariaDB, but that has not been verified.

Requirements

  • See composer.json for most dependencies.
  • A Unix-like OS.
  • The following commands:
    • mkfifo
    • mysqldump
    • bzip2
  • For now the above commands have to be available globally in the current path configuration in the corresponding shell used by the symfony/process component, so they can be called without requiring the absolute path.

Setup

  • Add AndreasA\BackupDatabaseBundle\AndreasABackupDatabaseBundle::class => ['all' => true], to config/bundles.php, if it has not been added by symfony/flex already.
  • Add the file config/packages/andreas_a_backup_database.yaml with a content like (example configuration):
    andreas_a_backup_database:
        database_url: '%env(resolve:DATABASE_URL)%'
        target_directory: '%kernel.project_dir%/var/backup'
        mysql:
            ignored_tables:
                - 'cache_items'
            options:
                - 'default-character-set=utf8mb4'
                - 'hex-blob'
                - 'no-tablespaces'
                - 'opt'
                - 'routines'
                - 'triggers'
            platform_specific_options:
                - 'column-statistics=0'
                - 'skip-column-statistics'

Configuration

  • database_url: The URL to the database.
  • target_directory: The directory where the backups are placed. Those files include the current date and time in their filenames.
  • mysql: Specific options for MySQL backups.
    • ignored_tables: Tables to be ignored during backup. Can also be set to [], if no tables should be ignored.
    • options: These options are used during backup and provided using the MySQL configuration file syntax. The mysqldump command has to support these options. Can also be set to [], if no additional options are necessary.
    • platform_specific_options: Basically the same as options but here the bundle first checks if the mysqldump command supports these options. This is relevant, if you do not know the used mysqldump version. Can also be set to [], if no platform specific options are necessary.

Command

The bundle provides the Symfony command andreas-a:backup:database. It uses the configuration above to create a database backup and can e.g. be used during deployments.

统计信息

  • 总下载量: 6.62k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-01