Posts

Showing posts with the label percona XtraBackup

Restore single database from full Xtrabackup backup

Percona Xtrabackup does not have any direct way to import single database. I have found a script to restore single database written by Phil Buescher . I have made few changes in the script. There are few perquisite to run the script. You can download the script from here . You need to use mysql-utility mysqlfrm to get the structure of the table from backup. But mysqlfrm works only for innodb tables. Prerequisite:     1. Table should be innodb engine.     2. innodb_file_per_table option should be enabled on the source server        before taking the backup.     3. If you have any view inside your backup directory, script will fail. It will        print the name of the file where it failed. You need to go inside backup directory and delete all the files related to those views. For restoring DB we need to have all the following backups. I am referring to the directory structure creat...

MySQL Backup with Incremental Levels

Image
The script is written to take backup of MySQL Database using Percona Xtrabackup. The innobackupex tool is a Perl script that acts as a wrapper for the xtrabackup C program. It allows us to take backup of Innodb without any locking and also takes backup of other engines like MyISAM with minimum locking. To read more about innobackupex, read the following links. Innobackupex Script How Innobackupex Works? You can download full script  here . Innobackupex provides 2 types of backups:- Full : Which will take the full backup of the given database from start to end. Incremental : It will only take the backup of changed blocks since last base backup or LSN(Log Sequence Number). The script will take setting from the variables defined and take backups accordingly. I have currently set it up as below. Every Sunday, it will take full backup of the DB provided. Every day at 0000 hours, it will take an incremental backup since last full backup ( Figure 1 ). It is going to t...