You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
4 years ago | |
|---|---|---|
| .. | ||
| Dockerfile | 4 years ago | |
| README.md | 4 years ago | |
| install.sh | 4 years ago | |
| restore.sh | 4 years ago | |
README.md
mysql-restore-s3
Restore a MySQL backup from S3 to MySQL
Warning
This will potentially put your database in a very bad state or complete destroy your data, be very careful.
Limitations
This is made to restore a backup made from mysql-backup-s3, if you backup came from somewhere else please check your format.
- Your s3 bucket must only contain backups which you wish to restore - it will always grabs the 'latest' based on unix sort with no filtering, unless exact name provided
- They must be gzip encoded text sql files
- If your bucket has more than a 1000 files the latest may not be restore, only one s3 ls command is made
Usage
Docker:
$ docker run -e S3_ACCESS_KEY_ID=key -e S3_SECRET_ACCESS_KEY=secret -e S3_BUCKET=my-bucket -e S3_PREFIX=backup -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_HOST=localhost schickling/mysql-restore-s3
Environment variables
MYSQL_HOSTthe mysql host requiredMYSQL_PORTthe mysql port (default: 3306)MYSQL_USERthe mysql user requiredMYSQL_PASSWORDthe mysql password requiredMYSQL_OPTSoptions to use when calling MySQL command (to set, e.g. encoding)S3_ACCESS_KEY_IDyour AWS access key requiredS3_SECRET_ACCESS_KEYyour AWS secret key requiredS3_BUCKETyour AWS S3 bucket path requiredS3_PREFIXpath prefix in your bucket (default: 'backup')S3_FILENAMEfilename from S3 used for backup. If not set, it will use the latest snapshot file.S3_REGIONthe AWS S3 bucket region (default: us-west-1)S3_ENDPOINTthe AWS Endpoint URL, for S3 Compliant APIs such as minio (default: none)S3_S3V4set toyesto enable AWS Signature Version 4, required for minio servers (default: no)