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.

37 lines
1.7 KiB

  1. # mysql-restore-s3
  2. Restore a MySQL backup from S3 to MySQL
  3. ## Warning
  4. This will potentially put your database in a very bad state or complete destroy your data, be very careful.
  5. ## Limitations
  6. This is made to restore a backup made from mysql-backup-s3, if you backup came from somewhere else please check your format.
  7. * 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
  8. * They must be gzip encoded text sql files
  9. * If your bucket has more than a 1000 files the latest may not be restore, only one s3 ls command is made
  10. ## Usage
  11. Docker:
  12. ```sh
  13. $ 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
  14. ```
  15. ## Environment variables
  16. - `MYSQL_HOST` the mysql host *required*
  17. - `MYSQL_PORT` the mysql port (default: 3306)
  18. - `MYSQL_USER` the mysql user *required*
  19. - `MYSQL_PASSWORD` the mysql password *required*
  20. - `S3_ACCESS_KEY_ID` your AWS access key *required*
  21. - `S3_SECRET_ACCESS_KEY` your AWS secret key *required*
  22. - `S3_BUCKET` your AWS S3 bucket path *required*
  23. - `S3_PREFIX` path prefix in your bucket (default: 'backup')
  24. - `S3_FILENAME` filename from S3 used for backup. If not set, it will use the latest snapshot file.
  25. - `S3_REGION` the AWS S3 bucket region (default: us-west-1)
  26. - `S3_ENDPOINT` the AWS Endpoint URL, for S3 Compliant APIs such as [minio](https://minio.io) (default: none)
  27. - `S3_S3V4` set to `yes` to enable AWS Signature Version 4, required for [minio](https://minio.io) servers (default: no)