Welcome to 10.5! Migrating Your Tiger MySQL Databases to Leopard

December 28th, 2007

After quite a bit of deliberation, I’ve decided to move up from Tiger to Leopard. Thankfully, the path to Rails w/ MySQL has been much easier than it ever was on Tiger.

So far, my greatest obstacle has been installing MySQL and bringing my old databases over from my backup. The gracious folks over at Hivelogic have created a brilliant, line-by-line tutorial for building MySQL on Leopard.

After getting MySQL up and running successfully, I completely overlooked the fact that my databases would be wiped clean. I realized the easiest thing to do would be to copy the databases from my Tiger backup.

Note: Both of my MySQL installs are Version 5, so I crossed my fingers hoping they’d be compatible and so far there’s been no problems.

Step 1. Make sure to turn off your current Leopard MySQL install. The command for this in the tutorial is: sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist which sends the unload command to your plist file.

Step 2. Locate the “data” or “var” folder in your MySQL backup directory. For instance, mine was in /usr/local/mysql on my Tiger install.

Step 3. sudo cp -rf /Volumes/Backup/usr/local/mysql/data /usr/local/mysql Or substitute the paths for the proper source and destination. This will copy the database folder from your Tiger backup to your fresh Leopard MySQL install.

Step 4. sudo chown -R mysql /usr/local/mysql/data mysql Give ownership of the database directory to the mysql user.

Step 5. Start up the server and you should be good to go!

Happy Leopard’ing.

2 Responses to “Welcome to 10.5! Migrating Your Tiger MySQL Databases to Leopard”

  1. Peter Says:
    Keep on blogging, we need you. I’ve got so much useful stuff from your blog and really value you opinion in this stuff.
  2. Chuck Says:
    Hey Peter. Thanks for the positive feedback! I'm not planning on quitting anytime soon. Cheers!

Sorry, comments are closed for this article.