|<<>>|20 of 30 Show listMobile Mode

OS X Leopard: Restoring from Backup (Ad hoc)

Published by marco on

Say you’re excited about having finally upgraded from OS X Tiger to Leopard more than two years after everyone else has already made the switch. Let’s say you’re not so excited that you completely lose your head and do a clean install without making a backup, but excited enough to forget that several Apple applications have rather convenient backup features baked right into them.

OS X offers a Migration Assistant with which you can migrate settings from another OS X installation or a Time Machine backup. However, it doesn’t see a SilverKeeper backup (a one-to-one copy of all files) as a valid OS X installation, so you can’t restore settings from that kind of a backup with this assistant.

It’s not the end of the world, though. Unlike Windows applications, which use installers to place entries in the registry and put files into the appropriate places, OS X applications are generally a drag & drop installation. So that’s the application itself, but what if you wanted to restore the preferences and user data that you so painstakingly configured and created in your old installation? It turns out that that’s not so hard either, once you know where things are.

OS X applications only create files within your user folder[1]—and only your user folder—and then in at most three folders:

  1. Preferences: Application configuration data
  2. Application Support: Application data which, if lost, cannot be recovered
  3. Caches: Application data which makes the application faster, but can always be reconstructed by combining data from Application Data, Preferences and other non-volatile sources.

Some Apple applications don’t stick exactly to this structure (e.g. Stickies, Safari, Mail, etc.), but third party applications are generally very good about this. One system-wide file you might want to copy is the ~/Keychain folder, which kept track of all of your passwords (dozens of which you’ve probably completely forgotten by now). For all other application-specific data, see the list below for tips.

Mail
Mail isn’t so tricky to restore. From the Preferences folder, copy any files whose name begins with com.apple.mail[2]. Copy the ~/Mail folder to your new user folder and you’re done. The ~/Mail Downloads folder seems to be some sort of cache and isn’t 100% necessary, but shouldn’t hurt either. When you start Mail in OS X Leopard, it will notify you that it is upgrading your mail store and voila! You’ve got mail.
iTunes
The iTunes library is stored entirely under ~/Music/iTunes. If you use the default settings, letting iTunes keep track of the music data, it suffices to copy this folder; if you have music stored elsewhere, it’s up to you to make sure the OS X Leopard iTunes knows where those files are.
iPhoto
As with iTunes, iPhoto’s data is located outside of the ~/Library, instead using the ~/Pictures/iPhoto folder. Just copy this over and you’ve got your pictures back.
Safari
If you use Safari, your bookmarks, saved form values and other preferences are in ~/Safari and your cookies are in ~/Cookies, should you wish to rescue them.
Tunnelblick
Tunnelblick is an OpenVPN GUI for OS X; it stores its configuration data in ~/openvpn instead of the Preferences folder. (This is most likely a requirement of the Unix-based OpenVPN subsystem.)
Dictionaries
If you added words to one or more dictionaries, those files are stored in ~/Spelling
Stickies
If you use the sticky notes application from Apple, you can just copy the ~/StickiesDatabase file over and you’ll have your notes back.
Address Book
The best solution here is to remember to back up this application’s data using the internal backup available from the File menu in the application itself. However, surprisingly, it only uses a folder in Application Support. Go Apple! Way to follow your own guidelines. Just copy this folder over and you’ve got your address book back.
iCal

As with the address book, the best solution is to use the internal backup available from the File menu in the application itself. Whereas under Tiger, iCal actually stored its data in the ~/Application Support folder, in Leopard, its data has moved to ~/Calendars. Simply copying the folders over isn’t going to work here, unfortunately; it’s a bit more complicated than that. Here’s a rough guide:

  1. In the backup, browse to the ~/Application Support/iCal/Sources folder; there, you will see one folder for each of your calendars, though with very cryptic-looking names.

    In order to tell which calendar is which, open a cryptically-named folder and quick-view the Info.plist file (press Space when the file is selected in the Finder); you should something like the following:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>Key</key>
    	<string>3BFD9C8E-88A4-4EEF-A8E2-0AC4E153E53F</string>
    	<key>Title</key>
    	<string>Work</string>
    	<key>Type</key>
    	<string>com.apple.ical.sources.naivereadwrite</string>
    </dict>
    </plist>

    The contents of the string element (highlighted above) immediately after the key element with the contents “Title” is the name of the calendar. If you were subscribed to calendars, then you don’t need to import those; you can just re-add the subscription URL to iCal directly.

  2. For each calendar you wish to import, from iCal select File, then Import… from the menu.
  3. Select the Import an iCal file option.
  4. Select the file ending in .ics from the folder containing the calendar you wish to import.
  5. Choose a calendar to which you wish to import the data. You can either import the data into an existing calendar (as you will likely do with the “Home” and “Work” calendars) or just create a new one.
  6. Press “Ok” to import the data and restore your calendar.
Other Third-party Applications
As mentioned above, it’s usually sufficient (in my experience, anyway) to copy data from Preferences and Application Support for the applications you want to transfer. This worked for Adium, Opera, TextMate, Cyberduck, Firefox, TriTag, CSSEdit, Delicious Library and Fission, but your mileage may vary.


[1] Referred to throughout the article with the path ~/.
[2] Most applications have either a single preferences file or create a whole sub-folder within the ~/Preferences folder. They all include their application name somewhere in either the folder or file name.