You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
# mysql-backup-restore
2
-
Service to backup and/or restore mysql databases to/from S3
2
+
Service to backup and/or restore mysql databases to/from S3 and optionally to B2
3
3
4
4
## How to use it
5
5
1. Create an S3 bucket to hold your backups
6
6
2. Turn versioning on for that bucket
7
+
2. (Optional) Create a B2 bucket to hold your backups
7
8
3. Supply all appropriate environment variables
8
-
4. Run a backup and check your bucket for that backup
9
+
4. Run a backup and check your bucket(s) for that backup
9
10
10
11
### Environment variables
11
-
`MODE` Valid values: `backup`, `restore`
12
+
`MODE` Valid values: `backup`, `restore`. Restores are implemented **only** from S3.
12
13
13
14
`DB_NAMES` list of the database names
14
15
@@ -18,19 +19,27 @@ Service to backup and/or restore mysql databases to/from S3
18
19
19
20
`MYSQL_DUMP_ARGS` (optional) additional arguments to the mysqldump command, e.g., `--max_allowed_packet=50M`
20
21
22
+
`S3_BUCKET` e.g., _s3://database-backups_**NOTE: no trailing slash**
23
+
24
+
>**It's recommended that your S3 bucket have versioning turned on.** Each backup creates a file of the form _dbname_.sql.gz. If versioning is not turned on, the previous backup file will be replaced with the new one, resulting in a single level of backups.
25
+
21
26
`AWS_ACCESS_KEY` used for S3 interactions
22
27
23
28
`AWS_SECRET_KEY` used for S3 interactions
24
29
25
-
`S3_BUCKET` e.g., _s3://database-backups_**NOTE: no trailing slash**
30
+
`B2_BUCKET` (optional) Name of the Backblaze B2 bucket, e.g., _database-backups_. When `B2_BUCKET` is defined, the backup file is copied to the B2 bucket in addition to the S3 bucket.
31
+
32
+
>**It's recommended that your B2 bucket have versioning and encryption turned on.** Each backup creates a file of the form _dbname_.sql.gz. If versioning is not turned on, the previous backup file will be replaced with the new one, resulting in a single level of backups. Encryption may offer an additional level of protection from attackers. It also has the side effect of preventing downloads of the file via the Backblaze GUI (you'll have to use the `b2` command or the Backblaze API).
33
+
34
+
`B2_APPLICATION_KEY_ID` (optional; required if `B2_BUCKET` is defined) Backblaze application key ID
26
35
27
-
>**It's recommended that your S3 bucket have versioning turned on.**
36
+
`B2_APPLICATION_KEY` (optional; required if `B2_BUCKET` is defined) Backblaze application key secret
28
37
29
38
## Docker Hub
30
39
This image is built automatically on Docker Hub as [silintl/mysql-backup-restore](https://hub.docker.com/r/silintl/mysql-backup-restore/).
31
40
32
41
## Playing with it locally
33
-
You'll need [Docker](https://www.docker.com/get-docker), [Docker Compose](https://docs.docker.com/compose/install/), and [Make](https://www.gnu.org/software/make/).
42
+
You'll need [Docker Engine](https://docs.docker.com/engine/) with the Docker Compose plugin and [Make](https://www.gnu.org/software/make/).
0 commit comments