Its been a while I wrote anything on MySQL and/or Database related things as I was on a long two month vacation and immediately had a job change.

Today I was playing a bit in trying to setup up the ZRM community backup on Cent OS 5 to have a incremental backup mechanism; to see how it works as I never had a chance to use it so far. In the process, I could not find a single source of document which explains the basic steps needed on first-hand setup (or my search did not yield the right docs), so thought of writing and noting it down myself for any future reference. More or less, the instructions should be same for any Linux favor.

Here are the steps:

  • First install perl-DBI and perl-XML-Parser modules
    sudo yum install perl-DBI perl-XML-Parser
    
     
    
  • Download and install ZRM package.
    sudo rpm -ivh MySQL-zrm-2.0-1.noarch.rpm 
    Password:
    warning: MySQL-zrm-2.0-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 3c5d1c92
    Preparing...                ########################################### [100%]
       1:MySQL-zrm              ########################################### [100%]
    Checking and Migrating old ZRM data
    
     
    
  • Create user called `backup_user` identified by `backup_user` in MySQL
    mysql> GRANT ALL ON *.* TO 'backup_user'@localhost IDENTIFIED BY 'backup_user';
    Query OK, 0 rows affected (0.00 sec)
     
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)

  • Add a new directory under /etc/mysql-zrm/ as ‘dailyrun’ and copy the mysql-zrm.conf to this directory
    sudo mkdir -p /etc/mysql-zrm/dailyrun
    sudo cp /etc/mysql-zrm/mysql-zrm.conf /etc/mysql-zrm/dailyrun/

  • Start editing the file /etc/mysql-zrm/dailyrun/mysql-zrm.conf and fill some of basic information and leave backup-level=1 and backup-mode=raw. The conf-file self-explains on every parameter, so it becomes easy for anyone to setup even for first time.
    
    

  • Start testing the backup using mysql-zrm-scheduler by issuing:
    sudo mysql-zrm-scheduler --now --backup-set dailyrun 
    
    

  • Once tested, add it to the standard daily scheduler to backup at 1 AM:
    mysql-zrm-scheduler --add --interval daily --start 01:00 --backup-set dailyrun

I am not going further to explain on how to verify the backup and restore it back, even though they are straight forward by using the ZRM utilities provided by the Zmanda; and complete information can be found from here.