Download the PHP package asmbs/mysql-s3-backup without Composer
On this page you can find all versions of the php package asmbs/mysql-s3-backup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package mysql-s3-backup
MySQL S3 Backup
Manages backups of a MySQL database to Amazon S3
Requirements
- PHP 7.2+
- MySQL 4.1.0+
- Composer 1.6.5+
Installation
-
Create an empty, non-versioned S3 bucket. The first time that the script runs, it will create 4 folders for you ("yearly", "monthly", "daily", and "hourly").
-
Copy
config.yaml.distto a new file namedconfig.yamlin the same directory and configure it to your needs, per the Configuration Reference below. -
Install the dependencies:
- Set up a single
cronjob to executeMySQLS3Backup.phponce every hour. Usingcrontab, an example line would be:
The backup files will be created in the format YYYY-MM-DD_HH-MM-SS.EXT, where EXT is the file extension based on the compression method chosen (sql for "None", gz for "Gzip", and bz2 for "Bzip2"). The file names should not be changed inside the bucket, or else the script will not be able to recognize the files.
Usage
You can manually execute the "manage" command by running:
To download a previous dump that was uploaded using client-side encryption, it must be downloaded with the "download-encrypted" command. You can do this by running:
Configuration Reference
s3argumentsversionThe S3 version to useregionThe S3 region to usecredentialskeyYour S3 keysecretYour S3 secret
client_encryptionenabledIf set to true, then dump files will be transferred to S3 using client-side encryption with an AWS KMS-managed customer master key. If set to false, then plain non-encrypted transfer will be used.argumentsversionregioncredentialskeysecret
key_arnThe ARN of the KMS-managed customer key to use. Typically, this will begin with "arn:aws:kms".cipher_options- Should be "cbc" or "gcm". See AWS PHP SDK documentation.
- Should be "128", "192", or "256". See AWS PHP SDK documentation.
snsenabledIf set to true, then exceptions will be sent to an Amazon SNS Topic. If set to false, exceptions will simply be outputted.argumentsversionregioncredentialskeysecret
topic_arnThe ARN of the Amazon SNS Topic to use. Typically, this will begin with "arn:aws:sns".
mysqlhostThe host on which your database is hosteddbnameThe name of your databaseusernameThe username to be used by MySQLpasswordThe password to be used by MySQL
appoutputIf set to true, then information will be outputted. If set to false, the script will run silently (except for exceptions).compressionThe compression algorithm to use. This should be 'None', 'Gzip', or 'Bzip2'. Note that bzip2 support is not enabled by default in PHP.maximum_backup_countsThis is the maximum number of backups to keep based on each time period. For example, setting 'yearly' to '7' will keep one backup for each of the past 7 years. When a day rolls over, the most recent 'hourly' backup will be used.yearlymonthlydailyhourlymirror_default_optIf set to true, then the dump settings will mirror the default--optsetting of MySQL's originalmysqldump.add_sql_extensionIf set to true, then.sqlwill be added before the compression extension (e.g..gz) in compressed backups.
All versions of mysql-s3-backup with dependencies
aws/aws-sdk-php Version ^3.61
symfony/yaml Version ^4.1
ifsnop/mysqldump-php Version ^2.7
symfony/console Version ^4.3