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.

I don't want to convert the tables to InnoDB what is the best way to take safe backup of my live site?

I've gone thru many posts in this site. I think there isn't unless we down the site in case of MyIsam. For InnoDB we can use --single-transaction.

I've been using mysqldump till now. But for live forums it may be risky to restore. It seems mysqldump does lock the tables but one by one which can corrupt the database tables.

I'm wondering what could be the best way to do using single command!

share|improve this question

2 Answers 2

One of the options is to set up replication and perform mysqldump on the slave server with --lock-tables. Alternative option is to stop the slave server for the time of the backup, copy/archive the data and then restart the mysql. This way you avoid mysqldump/restore procedure which is time-consuming for big data sets.

share|improve this answer
    
Good idea. But I'm not earning so much from my sites right now so I'd not like to go this far.. –  AgA Jul 4 '11 at 5:01

One suggestion would be to use the ZFS file system to store your databases, and then snapshot the filesystem. The approach is highly scalable, results in consistent snapshots, and does not lock the filesystem for any appreciable length of time (under a second?).

If your servers are on Amazon's cloud, you may consider the script ec2-consistent-snapshot. It works well with XFS filesystems, and essentially flushes the database, freezes the filesystem, takes a snapshot, and unfreezes the filesystem. While perhaps not entirely applicable to your setup, the procedure may still be relevant.

Both of the above work at the filesystem level as opposed to running through mySQL.

share|improve this answer
    
I'm having shared hosting account on Hostgator, I fear I can't do this. –  AgA Jul 4 '11 at 4:59

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.