Skip to main content

Mysql Enterprise Backup - Differential

we are going to test mysql Differential  backup using MEB Mysql Enterprise Backup


Step1: I am taking full backup of all the existing database to image and compressing them

mysqlbackup --user=root --password=Mysql@1234 --backup-dir=/u02/backuptesting/fullbackup --compress  --backup-image=/u02/backuptesting/fullbackup/newbackup.mbi backup-to-image

Step2:i am now creating a table backuptest in a test database and adding some data in to table 
use test;
CREATE TABLE backuptest (
  id_customer int(10),
  monthly_limit int(11),
  PRIMARY KEY (`id_customer`)
);

insert into test.backuptest (id_customer,monthly_limit) values ('1','2000');

Step 3: do Differential Backup
here i am giving --incremental-base as dir; which species to the path where fullbackup is taken  , so it means it will take a backup of all
changes from the last fullbackup upto now.
mysqlbackup  --user=root --password=Mysql@1234 --incremental --incremental-base=dir:/u02/backuptesting/fullbackup --backup-dir=/u02/backuptesting/differential --encrypt-password=Mysql@1234 --compress --backup-image=/u02/backuptesting/differential/mybackup-inc.mbi backup-to-image

Step4:restoring fullbackup
restore the full backup to one location (/u02/backuptesting/fullbkpextred)
mysqlbackup  --defaults-file=/u02/backuptesting/fullbackup/backup-my.cnf  --datadir=/u02/backuptesting/fullbkpextred  --backup-image=/u02/backuptesting/fullbackup/newbackup.mbi  --backup-dir=/u02/backuptesting/temp --uncompress   copy-back-and-apply-log

Step5:applying differential backup on top of it.
i am restoring diiferentialbackup to exixting retored fullbackup location so here datadir will be (/u02/backuptesting/fullbkpextred)
mysqlbackup  --defaults-file=/u02/backuptesting/differential/backup-my.cnf --backup-image=/u02/backuptesting/differential/mybackup-inc.mbi --incremental-backup-dir=/u02/backuptesting/temp1 --datadir=/u02/backuptesting/fullbkpextred --uncompress --encrypt-password=Mysql@1234 --incremental copy-back-and-apply-log

Comments