Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Does Time Machine back up MySQL database?

My medical practice billing software runs on MySQL. I upgraded to Leopard specifically to enable Time Machine backups - more frequent than nightly backups, with recovery much faster in the event of problems in the middle of a busy day. The software vendor tech rep stated that the MySQL database is not backed up by Time Machine. That seems very strange, since it backs up all the System files and everything else not specifically excluded. Am I missing something?

MacBook Pro 17", Mac OS X (10.5.5)

Posted on Sep 25, 2008 2:39 PM

Reply
4 replies

Sep 25, 2008 3:16 PM in response to Jeffrey Hull1

TM will backup everything on your drive that has not been put in the Excluded list. Is the database missing in your TM backup? I know there is a problem related to Aperture, but I haven't come across one related to MySQL. What software vendor told you this? What specific evidence did they cite to support it? I would ask about this. Although it sounds unusual it could be correct if there is something peculiar about the MySQL installation that would bar it from being backed up for some reason.

Sep 25, 2008 3:28 PM in response to Kappy

It is MacPractice. He did not cite anything to back up the statement. He wrote:

"Time Capsule is a backup device that works with Time Machine in Mac OS X Leopard, automatically backing up everything. However, it only backups the MacPractice Backup folder, it does not backup the MySQL Database. You will need to continue backing up MacPractice as before."

I thought that was an odd concept. We'll still do nightly backups, but I feel more comfortable about the Time Machine backups. Thanks for the reply.

Sep 25, 2008 3:46 PM in response to Jeffrey Hull1

I don't understand what he said. It sounds like something to do with the Exclude list of TM preferences. Are you only backing up the MacPractice folder or is TM backing up your entire hard drive? What it reads to me is that if you backup only the MacPractice folder that the folder does not include the MySQL database. That is correct since MySQL creates the database file in its own special folder. But if you backup the entire hard drive then everything is backed up including the database files.

BTW, since this is a business entity I would strongly advise that you not rely entirely on Time Machine backups. TM can be finicky and unreliable. Potential problems escalate when you use a Time Capsule because of the mechanism TM uses for backing up networked drives such as TC.

I would recommend you use another backup utility and do additional backups to other external or internal drives depending upon what your computer supports. You should also make at least one separate full backup archive monthly that can be stored off-site in the case of theft, vandalism, storm, earthquake, or other hazard that could result in loss of data. See the following:


Basic Backup

Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):

1. Retrospect Desktop (Commercial - not yet universal binary)
2. Synchronize! Pro X (Commercial)
3. Synk (Backup, Standard, or Pro)
4. Deja Vu (Shareware)
5. Carbon Copy Cloner (Donationware)
6. SuperDuper! (Commercial)
7. Intego Personal Backup (Commercial)
8. Data Backup (Commercial)

The following utilities can also be used for backup, but cannot create bootable clones:

1. Backup (requires a .Mac account with Apple both to get the software and to use it.)
2. Toast
3. Impression
4. arRSync

Apple's Backup is a full backup tool capable of also backing up across multiple media such as CD/DVD. However, it cannot create bootable backups. It is primarily an "archiving" utility as are the other two.

Impression and Toast are disk image based backups, only. Particularly useful if you need to backup to CD/DVD across multiple media.

Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore. Also read How to Back Up and Restore Your Files.

Although you can buy a complete FireWire drive system, you can also put one together if you are so inclined. It's relatively easy and only requires a Phillips head screwdriver (typically.) You can purchase hard drives separately. This gives you an opportunity to shop for the best prices on a hard drive of your choice. Reliable brands include Seagate, Hitachi, Western Digital, Toshiba, and Fujitsu. You can find reviews and benchmarks on many drives at Storage Review.

Enclosures for FireWire and USB are readily available. You can find only FireWire enclosures, only USB enclosures, and enclosures that feature multiple ports. I would stress getting enclosures that use the Oxford chipsets (911, 921, 922, for example.) You can find enclosures at places such as;

Cool Drives
OWC
WiebeTech
Firewire Direct
California Drives
NewEgg

All you need do is remove a case cover, mount the hard drive in the enclosure and connect the cables, then re-attach the case cover. Usually the only tool required is a small or medium Phillips screwdriver.

Sep 28, 2008 8:15 PM in response to Jeffrey Hull1

MySQL stores its data in a hidden system folder at /usr/local/mysql/data. This folder contains the MySQL data in binary form inside a folder with extremely restrictive permissions (ie, you can't, and shouldn't, be opening it to tinker with the contents). One would have to run a specific command -- mysqldump -- in order to create a backup of the MySQL data. (See http://dev.mysql.com/doc/refman/5.0/en/backup-and-recovery.html) This would create a file containing all the SQL commands necessary to recreate the database in MySQL.

I don't believe it's possible to restore a MySQL database from the binary data store. I've tried it myself as an experiment once without any success.

Time Machine does create a duplicate of the MySQL data folder. But because of the binary data format, as well as the restrictive permissions on that directory, the TM backup isn't useful for reliably restoring the MySQL data.

I have been using rsnapshot ( http://www.rsnapshot.org/) and custom AppleScript scripts to automate a Time Machine-like backup. In addition to copying my normal files, I have to run mysqldump to generate a backup of MySQL data which is then saved as part of the backup.

A solution with Time Machine may be to run the mysqldump command periodically/automatically (possibly via launchd or cron?), save the backup out to a known, accessible directory, and then let Time Machine backup the MySQL "dump" into the TM backup store.

Does Time Machine back up MySQL database?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.