Sunday, May 31, 2009

Restoring Mail, but not via MobileMe Account Backups

Time Machine Mail PlistSo much for MobileMe backing up my Mail account data! I had a another weird crash, which has been plaguing me since I upgraded OS X Leopard to 10.5.7. The crash happens when I wake the computer from sleep, and plug in my firewire then USB hard drives. When the USB hits the socket, sometimes I get the grey screen of death, in which the only way to recover is a hard reset. This happened again today, but this time, the hard reset broke Mail. After booting up, I started Mail and the only account I had was my MobileMe account. My Google accounts were gone.

I thought, ah hah!, I'll recover from MobileMe's copies of my Mail Accounts. No dice. It must have quickly pushed to MobileMe, the change that happened when the system crashed, so syncing MobileMe did nothing to recover. Searching the web a little, I found various information about restoring the entire mail folder and so on, but it turned out that my mail data, in ~/Library/Mail, seemed intact. So, I decided to try to restore my Mail plist file first, from Time Machine backup, and see if that would fix the problem.

How to Restore Mail.app

Here's how I restored it:

  • Close Mail.
  • Plug in the Time Machine drive.
  • Press option while clicking the Time Machine icon in the menu bar, select "Browse Other Time Machine Disks" and choose your Time Machine disk. You can display this icon in Time Machine preferences. Note, if you use Path Finder, a Finder replacement, like I do, start Finder before you do any Time Machine work.
  • Enter Time Machine, and find your last Mail plist backup. In Time Machine, just click a folder or two "back", and see what the date on the file is. The file is ~/Library/Preferences/com.apple.mail.plist where ~ is your home folder.
  • Affirm the overwrite, when the restore process asks if you want to replace the file with an older version.
  • Start Mail.

This worked. All my mail was present and accounted for. If my mail had been damaged, I could do the same procedure, but after stopping Mail, just rename the Mail folder ~/Library/Mail to something else like ~/Library/Mail-Backup, and restore both the Mail folder and the plist file from your Time Machine backup. It will take quite a bit longer to achieve, but it should work.

I hope this helps someone. Enjoy, and good luck recovering.

No comments: