Aston J

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

Posted on: November 24th, 2011 by AstonJ 3 Comments

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 AppleShowAllFiles YES

Or if you’re on Yosemite:

defaults write AppleShowAllFiles -boolean true ; killall Finder

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


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.


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)



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.


    Hi, excelet!! even by including Cyberduck!!!! the migration to new Mountain Lion was succesful. Now, how can I hide the files. thank you.

    • AstonJ

      Hi Andres, just use:

      defaults write AppleShowAllFiles NO

      • http://NA ANDRES B

        Perfect!!!, Thank you.