Difference between revisions of "Percona XtraBackup"

From DevOps Notebook
Line 1: Line 1:
 
== Backup and restore with XtraBackup 8.0 ==
 
== Backup and restore with XtraBackup 8.0 ==
 
''Note that credentials need to be in .my.cnf in home folder of running user''
 
''Note that credentials need to be in .my.cnf in home folder of running user''
Backup:
+
=== Backup with Percona XtraBackup 8.0 ===
 
<pre>
 
<pre>
 
$ xtrabackup --backup --target-dir=/path/to/backups/
 
$ xtrabackup --backup --target-dir=/path/to/backups/
Line 7: Line 7:
 
</pre>
 
</pre>
  
Restore:
+
=== Restore with Percona XtraBackup 8.0 ===
 
''Backup needs to be prepared before it can be restored'' <br>
 
''Backup needs to be prepared before it can be restored'' <br>
 
Method 1:  
 
Method 1:  

Revision as of 16:17, 21 March 2020

Backup and restore with XtraBackup 8.0

Note that credentials need to be in .my.cnf in home folder of running user

Backup with Percona XtraBackup 8.0

$ xtrabackup --backup --target-dir=/path/to/backups/
$ xtrabackup --prepare --target-dir=/path/to/backups/

Restore with Percona XtraBackup 8.0

Backup needs to be prepared before it can be restored
Method 1:

$ xtrabackup --copy-back --target-dir=/path/to/backups/

Method 2:

$ rsync -avrP /path/to/backup/ /var/lib/mysql/
$ chown -R mysql:mysql /var/lib/mysql