aldarien / backup
Backup databases
Installs: 24
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
pkg:composer/aldarien/backup
Requires
- aldarien/root: ^1.0
- danielstjules/stringy: ^3.1
- nesbot/carbon: ^1.33
- slim/slim: ^3.10
- symfony/yaml: ^4.1
Requires (Dev)
- phpunit/phpunit: ^7.3
This package is not auto-updated.
Last update: 2025-10-29 20:41:34 UTC
README
Database backup manager
Concept
This program integrates to your app via Middleware and backups your database according to the configuration. It checks for the last backup, and if the frecuency is met, it runs.
What it does
- Check last backup
- Extract data from Database
- Save to a File or other Database
What has been implemented
- MySQL Database extractor
- YAML File saver
- JSON File saver
- XML File saver
What is in development
- SQL File saver
- MySQL Database saver
Installation
Get the latest version with composer aldarien/backup
Usage
- First define a configuration
- Then load \App\Middleware\Backupwith the$app.
Configuration
[ "source" => [ "driver" => "mysql", "database" => [ "host" => [ "name" => "<hostname>", "[port]" => "<port>" ], "name" => "<database name>", "user" => [ "name" => "<user name>", "password" => "<user password>" ] ] ], "output" => [ "[files]" => [ "[path]" => "<files path"> "name" => "<filename>", "types" => [ "<file type1>", "<file type2>" ] ], [ "type" => "<file type>", "name" => "<filename>", "[path]" => "<file path>" ], [ "type" => "<file type>", "name" => "<filename>" ] ], "backup" => [ "location" => "source|file", "[file]" => "<filename>" "frecuency" => [ "value" => <n>, "unit" => "hours|days|months" ] ] ];
- 
backupThe app settings.- locationWhere the last backup is registered.
- fileOptional. If the location is a file, the file setting holds where the file is located. It needs to be writable by the app.
- frecuencyHow often is the backup made.- valueThe value of how often to do a backup.
- unitThe unit of frecuency. Can be- hours,- daysor- months.
 
 
- 
sourceThe source database information.- driverThe type of database. Currently only- mysqlis supported.
- databaseThe database information.- host- nameThe host name.
- portOptional. The port when it is different than the default settings.
 
- nameThe database name.
- userThe user information.- nameThe user's name.
- passwordThe user's password.
 
 
 
- 
outputMultiple outputs can be specified. Foreach one the same settings are needed.- filesOptional. If this is set, then all other output items are ignored. It serves as a summary with all the files named the same and saved in the same place.- pathOptional. Where the files are saved.
- nameFilename for the different types.
- typesArray with all the file types.
 
- typeThe file type. Can be- yaml,- json,- xmland- sql.
- nameThe filename without the extension.
- pathOptional. The location of the saved file.