Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In regards to:

Remounting MySQL under a new mount point

What would be the best way to backup MySQL data before moving the mount point? Can this be done with MySQL running? Would a simple rsync off to another server work?

share|improve this question
    
WOuld you like to change just the mount point or also switch to another server ? –  golja Oct 25 '12 at 12:06
    
Just changing mount point. / is full –  Tiffany Walker Oct 25 '12 at 12:07
    
then the instruction from the post you already mentioned in your question are fine. –  golja Oct 25 '12 at 12:09

2 Answers 2

up vote 0 down vote accepted

You can also backup your mysql database directory using rsync just add -a option in your command to preserve owner & permission.

rsync -arvz source destination.

share|improve this answer
2  
This may cause problems (including data corruption) if you do it while MySQL is running. –  Ladadadada Oct 25 '12 at 12:38

Simple backup with MySQL downtime

  1. Stop MySQL - /etc/init.d/mysql stop
  2. Backup data directory - tar czf /var/backups/mysql-2012-10-25.tar.gz /var/lib/mysql

Backup using XtraBackup

Percona XtraBackup can be used to take online hot (non-blocking) backups of your database.

share|improve this answer
    
Anyway to do this without stopping mysql? This is a production system with close to 3GBs worth of MySQL database information. That could be a lot of downtime to tar. –  Tiffany Walker Oct 25 '12 at 12:06
    
Yeah, I will edit the answer with an additional solution. –  pkhamre Oct 25 '12 at 12:07
    
XtraBackup is non-locking on InnoDB tables but requires a read lock on all tables to do MyISAM. If you have a mix of the two, the lock will only be in place while the MyISAM tables are being backed up. –  Ladadadada Oct 25 '12 at 12:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.