How to restore your mail, keychain, and other important files

This post is part of my series on Clean Lion install for Ruby Development.

Following on from your clean Lion install, we’ll now restore important files to make life easier, my list is below yours might vary slightly:

  • Mail
  • Keychains
  • Address book
  • Cyberduck bookmarks
  • Opera wand, bookmarks, speedial
  • .ssh folder


Make sure hidden files are switched on first, in the terminal type:

defaults write com.apple.Finder AppleShowAllFiles YES

Or if you’re on Yosemite:

defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder

Then hold down the alt key, right click the finder icon in your dock and select ‘relaunch finder’.

Mail

Simply copy over the contents of the Mail folder from /.Library/Mail from your back-up disk, to your new disk. Don’t open your Mail program until you’ve done the next step.

Keychain

On your new install, go to /.Library/Keychains and rename login.keychain to login.keychain-original and then copy over login.keychain and metadata.keychain from your back-up. Then restart your machine.

It’s ok to open Apple Mail now – all your email accounts and email should be present, the only thing you’ll have to do is re-arrange the left panel to how you like it (all mailboxes should be present though).

Address Book, Cyberduck and Opera

Copy the contents of /.Library/Application Support/Address Book, from the back-up to the new install.

Same for Cyberduck Bookmarks: /.Library/Application Support/Cyberduck/Bookmarks

Opera Wand, Bookmarks, speedial.ini:

(Install Opera first)

/.Library/Opera/wand.dat
/.Library/Opera/speedial.ini
/.Library/Opera/bookmarks.adr

.ssh

Copy the contents of /.ssh into a new folder .ssh – into the root of your home folder.

Repeat for any other (non-dev) program files you need

You can repeat this for any other important program files you need – just install the programs first. Hang on a tick for any dev files, such as Xcode as that’s coming up in a bit.

Restoring the rest of the home directory

If you’re _not_ splitting up your home folder so that it’s spread over multiple drives then go ahead and copy over your files into the appropriate folders. Otherwise leave them as they are for now until you get to the step that shows you how to set things up for multiple drives.