D
D
Daniil Muidinov2019-04-29 13:35:11
MySQL
Daniil Muidinov, 2019-04-29 13:35:11

How to restore a separate database using mariabackup?

How to restore a separate database using mariabackup?
I do backup like this

mariabackup --backup \
--databases=db_name \
--stream=xbstream | gzip > /root/backupstream.gz

I unpack on the server where I want to transfer the database I
gunzip -c backupstream.gz | mbstream -x
prepare
mariabackup --prepare --export \
   --target-dir=/target/dir/

The documentation goes on to describe how to restore individual tables, but how can you restore the entire database?
https://mariadb.com/kb/en/library/innodb-file-per-...
I use the --databases key on the source host, there are other databases, as well as on the target
. With this key, judging by the dock , turns out Partial Backup
For a partial backup, there are a few other arguments that you can provide as well:
To tell it which databases to backup, you can provide the --databases optio

And this case
The restore process for partial backups is quite different than the process for full backups. A partial backup is not a completely functional data directory. The data dictionary in the InnoDB system tablespace will still contain entries for the databases and tables that were not included in the backup.

Rather than using the --copy-back or the --move-back, each individual InnoDB file-per-table tablespace file will have to be manually imported into the target server. The process that is used to import the file will depend on whether partitioning is involved.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2019-04-29
@dimonchik2013

https://mariadb.com/kb/en/library/full-backup-and-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question