{"id":19664616,"url":"https://github.com/sourcebroker/database-backup","last_synced_at":"2026-05-16T07:37:00.527Z","repository":{"id":57056076,"uuid":"126488923","full_name":"sourcebroker/database-backup","owner":"sourcebroker","description":"Database backup done with PHP. Strong emphasis is put to sane defaults but with ability to fine tune each possible settings.","archived":false,"fork":false,"pushed_at":"2020-03-08T09:57:49.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-10T02:20:24.500Z","etag":null,"topics":["backup-database","database","magento","magento2","sb-dbbckp","typo3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcebroker.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-23T13:27:31.000Z","updated_at":"2021-06-03T17:03:31.000Z","dependencies_parsed_at":"2022-08-24T06:01:02.328Z","dependency_job_id":null,"html_url":"https://github.com/sourcebroker/database-backup","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fdatabase-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fdatabase-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fdatabase-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcebroker%2Fdatabase-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcebroker","download_url":"https://codeload.github.com/sourcebroker/database-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240974376,"owners_count":19887296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup-database","database","magento","magento2","sb-dbbckp","typo3"],"created_at":"2024-11-11T16:18:19.536Z","updated_at":"2026-05-16T07:36:55.504Z","avatar_url":"https://github.com/sourcebroker.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Database backup\n===============\n  \n.. contents:: :local:  \n\nWhat does it do?\n----------------\n  \nThis package allows to do database backup. Strong emphasis is put to sane defaults  \nbut with ability to fine tune each possible settings.  \n\nFeatures\n--------\n\n* Support for multiple configurations sets.  \n  \n* Cron like way to set when database backup program should run.  \n  \n* Detects what application uses database and ignores tables which are not important (like  \n  caching tables). Whitelist / blacklists for detected application database.  \n  \n* Databases whitelist / blacklists.  \n  \n* Prepared to support different storages (so far only \"local\" storage is supported).\n\n* On demand mode - execute only if needed.\n\nInstallation\n------------\n\n.. code-block:: bash\n\n  composer require sourcebroker/database-backup\n\nUsage\n-----\n\nSample configuration creation command:\n\n.. code-block:: bash\n\n  php bin/backup db:default-configuration\n\nDescription:\n\n.. code-block:: bash\n\n  --dry-run  \n    Perform action without saving any data. This option is for testing purpose.\n  \nBackup database command:\n\n.. code-block:: bash\n\n  php bin/backup db:dump [--dry-run] [--] \u003cyaml config\u003e\n\nDescription:\n  \n.. code-block:: bash\n\n  --dry-run  \n    Perform action without saving any data. This option is for testing purpose.  \n  \n  \u003c yaml config \u003e  \n    Configuration file containing backup tasks.\n  \nSimplest usage example:\n\n.. code-block:: bash\n\n  php bin/backup db:dump config.yaml\n\nSimplest config.yaml. The config below will do backup at 1 am with 2 day rotation.  \n\n.. code-block:: yaml\n\n  configs:  \n    dayilyAt1am:  \n      cron:  \n        howMany: 2  \n        pattern: \"0 1 * * *\"\n  \nYou can add more configs into one file. The config below will do backup at 1am with 7 days rotation  \nand at every 15 min of hour with rotation last 5 hours.  \n\n.. code-block:: yaml\n\n  configs:  \n    dayily:  \n      cron:  \n        howMany: 7  \n        pattern: \"0 1 * * *\"  \n    hourly:  \n      cron:  \n        howMany: 5  \n        pattern: \"15 * * * *\"\n\n\nConfiguration\n-------------\n  \nMore information about configuration below.\nSample configuration for Magento and TYPO3 available in ./sample directory.\n\n\nDefault configuration (built-in)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  \n.. code-block:: yaml\n\n  defaults:  \n    tmpDir: \".tmp\"              # temporary files directory  \n    flagDir: \".flag\"            # flag files directory  \n    defaultsFile: \"~/.my.cnf\"   # path to file with authentication data  \n  \n    binaryDbCommand: \"\"         # mysql binary path (replaced with `which mysql` if empty)  \n    binaryDbExport: \"\"          # mysqldump binary path (replaced with `which mysqldump` if empty)  \n    binaryPacker: \"\"            # zip binary path (replaced with `which zip` if empty)\n  \n    databaseAccess:             # database access branch  \n      type: \"default\"             # authentication type (described below)  \n      path: \"\"                    # path to file with db authentication data  \n      data:                       # authentication data (direct)  \n        user: \"\"                    # username  \n        password: \"\"                # password  \n        port: \"\"                    # database port  \n        host: \"\"                    # database port  \n  \n    storage:                    # storage description branch  \n      local:                      # local storage  \n        path: \".dump\"               # path to local directory where backuper will store packs  \n  \n    application:                # application autodetection branch  \n      typo3:                      # app name  \n        tables:                     # tables description  \n          detection:                  # detect application depending on existance of tables  \n            - \"tt_content\"  \n          whitelist:                  # include those tables in backup  \n            - \".*\"  \n          blacklist:                  # exclude those tables from backup  \n            - \"cf_.*\"  \n          whitelistPresets: []        # not implemented yet  \n          blacklistPresets: []        # not implemented yet  \n  \n      magento:  \n        tables:  \n          detection:  \n            - \"core_config_data\"  \n          whitelist:  \n            - \".*\"  \n          blacklist:  \n            - \"/^cache.*$/\"  \n            - \"/^log_.*$/\"  \n          whitelistPresets: [],  \n          blacklistPresets: []  \n  \n    tables: {}                  # tables branch (check \"tables configuration\" section below)\n  \n    databases:                  # databases branch\n      whitelist:                  # include those tables in backup  \n        - \".*\"  \n      blacklist:                  # exclude those tables from backup  \n        - \"information_schema\"  \n      whitelistPresets: []        # not implemented yet  \n      blacklistPresets: []        # not implemented yet  \n      presets: []                 # not implemented yet\n  \nUser configuration (yaml file)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  \n.. code-block:: yaml\n\n  # Defaults branch  \n  # Here you can specify values  \n  defaults:  \n    \u003cany branch\u003e                # any branch from default configuration may be overriden here  \n  \n  # Tasks configuration branch  \n  # You can define multiple backup tasks. Each one may be executed on command run,  \n  # depending on cron pattern and 'onDemand' flag  \n  configs:  \n  \n    catalogOnDemand:            # task name  \n      cron:                       # CRON description  \n        howMany: 10                 # how many backups should be stored  \n        pattern: \"* * * * *\"        # CRON time pattern  \n        onDemand: true              # set if this mode should be executed only on demand (optional)  \n  \n      \u003cany branch\u003e              # any branch from defaults may be overriden here\n\nDatabase authentication\n^^^^^^^^^^^^^^^^^^^^^^^\n  \nThere are 4 available modes of authentication:  \n  \n1. `'default'` - using configuration file (MySQL configuration format) given as `'path'` on databaseAccess level (default  ~/.my.cnf)  \n2. `'env'` - reads authentication data from environment (.env file may be used)\n3. `'php'` - .. from PHP file  \n4. `'xml'` - .. from XML file  \n\nTables configuration\n^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: yaml\n\n  tables:\n    _default_:                  # default tables configuration (for all databases)\n      whitelist:                  # include those tables\n        - \".*\"                      # regular expression\n      blacklist:                  # exclude those tables\n        - \"cache_.*\"\n\n    \u003cdatabase name\u003e:            # database level branch (override _default_ configuration)\n      whitelist:                  # include those tables (from given database)\n        - \"important_.*\"\n      blacklist:                  # exclude those tables (from given database)\n        - \"cache_.*\"\n        - \"log_.*\"\n\nIf task has `onDemand` mode set it will be executed only conditionally.  \nThat task will be executed only if flag file is created in flag directory (defined in `'flagDir'`)  \nFile name is task name in lowercase - so for task `catalogOnDemand` it will be `catalogondemand`.\n\nOn demand mode\n^^^^^^^^^^^^^^\n\nIf task has `onDemand` mode set it will be executed only conditionally.\nThat task will be executed only if CRON time pattern is fulfilled and if flag file is created in flag directory (defined in `'flagDir'`)\nFile name is task name in lowercase - so for task `catalogOnDemand` it will be `catalogondemand`.\n\nUsage cases:\nBackup orders tables immediately after new order is placed.\nModify your application in a way that it will create flag file in defined directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcebroker%2Fdatabase-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcebroker%2Fdatabase-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcebroker%2Fdatabase-backup/lists"}