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
If you wish to take a copy of the `/backup` you can do so without stopping the container or getting an inconsistent backup.
215
+
216
+
```console
217
+
$ docker exec --user mysql some-%%REPO%% tar -cf - /backup | xz > backup.tar.xz
218
+
```
219
+
220
+
## Restore backups with Mariabackup
221
+
222
+
These steps restore the backup made with Mariabackup.
223
+
224
+
At some point before doing the restore, the backup needs to be prepared. Here `/my/own/backupdir` contains a previous backup. Perform the prepare like this:
225
+
226
+
```console
227
+
$ docker run --user mysql --rm -v /my/own/backupdir:/backup %%IMAGE%%:latest mariabackup --prepare --target-dir=/backup
228
+
```
229
+
230
+
Now that the image is prepared, start the container with both the data and the backup volumes and restore the backup:
231
+
232
+
```console
233
+
$ docker run --user mysql --rm -v /my/own/newdatadir:/var/lib/mysql -v /my/own/backupdir:/backup %%IMAGE%%:latest mariabackup --copy-back --target-dir=/backup
234
+
```
235
+
236
+
With `/my/own/newdatadir` containing the restored backup, start normally as this is an initialized data directory:
237
+
238
+
```console
239
+
$ docker run --name some-%%REPO%% -v /my/own/newdatadir:/var/lib/mysql -d %%IMAGE%%:latest
240
+
```
241
+
242
+
For further information on Mariabackup, see the [Mariabackup Knowledge Base](https://mariadb.com/kb/en/mariabackup-overview/).
0 commit comments