How to Transfer Mac OS X Application Data between Computers

Mac OS XIts been a long time coming, but I finally got a new Mac. I’ve personally owned a Mac of one sort or another since 1987, but I didn’t start using a Mac full time for work until around 2000. I’ve been going through the process of setting up the new machine.

I decided to start from scratch on the new machine, rather than use the migration assistant. The previous machine had been the subject of countless experiments and upgrades. I wanted to start from a clean slate. I chose to reinstall all software and just transfer data files form the old machine to the new one.

I am recording the process on this blog to remind myself for next time and also hoping it might help someone else trying to do the same thing. I’ll probably do this again when I migrate from Tiger (OS X 10.4) to Leopard (OS X 10.5).

This guide may favor the Unix geek, but I’ll try to keep it non-geeky. If you’re uncomfortable with anything here, use the Apple migration assistant instead. These instructions represent what I actually did to move between machines. Your situation may be different. Use these instructions at your own risk. When in doubt, use the Apple supplied migration assistant. Always make backups of your old data.

I’ll assume that you can get your old mac and your new Mac talking on a network (You don’t even need a cross over cable), and that you can figure out how to enable file sharing on your old system so you can transfer your files over.

Do a Clean Install

InstallerMy Mac came ready to go. All I had to do is turn it on and answer a few networking and registration questions and I was, um productive, making comic books for the kids and playing with the iSight. However, I decided to wipe the hard drive and do a complete re-install.

There were a few reasons for this. One was to be able to play with impunity for a period of time, knowing that I could wash away my mistakes and experiments. Another was to be able to do a custom install. This laptop drive is fairly small for what I want to do with it. During my custom install, I omitted a bunch of printer drivers, trial apps and language translations to save a gig or two. Its never going to be easier to do this than now. Third, I just wanted to make sure that I could rebuild the system from scratch, while I still had a warrenty and tech support available.

I’m extremely conservative with my work system. I rely on it and I want it to work when I need it. I feel its better to allocate a fixed amount of time now to learn how to rebuild, rather than have spend an indeterminate amount of time with it in the event of some mishap.

When I re-installed, the first user I created on the new machine had the same short name as the primary user on the old machine. I haven’t tested these techniques for moving user accounts with different names, but overall I think they should work.

Moving your keychain

KeychainThe first thing to do after to get your machine is to copy your keychain from your old computer to the new one. The keychain contains all of your passwords. Its also one of the few centralized databases on the Mac that you can’t just regenerate. Its best to migrate it before you launch any programs on the new machine that might require authentication.

You can open the Keychain Access application to view and manage your passwords. Each User’s keychain is stored in their ~/Library/Keychains directory. (The ~ means this directory is a subdirectory of your user home directory.)

I just copied the login.keychain file from the old system and replaced the one on the new system. I would recommend logging out and logging back in after replacing the old file.

You may also want to migrate your system level keychain. This is located in /Library/Keychains/system.keychain. Notice that this is not in your user directory, but is a subdirectory of your main hard drive. I didn’t bother to migrate this one, but rather to enter the handful of passwords that it contained. If you do overwrite this file, make sure you look at its ownership & permissions via get info in the finder first, and restore the permissions after you are done.

You may want to do Keychain First Aid on the File menu of the Keychain Access application after this process, just to make sure everything is ok.

Move your Cookies

CookieI could never figure out why some people are so paranoid about cookies. Here is your chance to get rid of them all. Well, I don’t wear a tin foil hat; I want to keep my cookies. My cookies only take up 1.5MB after years of browsing on my mac. Having a smaller cookie file probably won’t make my browsing experience any better, and there are so many it really isn’t worth trying to sift through them. For me, the best option is to migrate the whole cookie file.

Safari and WebKit cookies are stored in ~/Library/Cookies/cookies.plist. Copying this file from the old machine to the same location on the new machine will transfer all of your cookies.

I don’t do anything cookie-worthy in any browser except Safari, so I didn’t bother migrating any of the cookies in the alternative browsers I have installed. If you have FireFox cookies that you want to preserve, I believe they are located in FireFox’s Application Support folder and will migrate just fine using the generic Migrating a Mac OS X Application instructions below.

Migrating User Data and Documents

HomeMoving your User data is easy. Just open your home folder on the old machine and copy all of the subdirectories you see to the new machine except for the ~/Library direcctory. Actually, you could copy the ~/Library directory wholesale, too, but the purpose of this post is to start with a clean slate of application settings and support files and most of these live in the Library directory.

The typical folders you will copy over are ~/Desktop, ~/Documents, ~/Movies, ~/Music and ~/Pictures. There shouldn’t be anything of consequence in these directories on the new machine. You can probably just replace them. You may also want to copy your ~/Public and ~/Sites directories if you have anything in them.

You want to copy over your data files before you launch any applications that might use that data, for example iPhoto or iTunes.

Migrating a Mac OS X Application

ApplicationAlmost all native OS X applications use the same file organization for their files. The settings for almost all applications can be transferred by looking in two places.

The ~/Library/Application Support directory contains folders with the same name as each application. copy the folders from the old machine to same location on the new machine for the applications whose support data you want to keep.

The ~/Library/Preferences directory contains many individual files (and sometimes a folder or two). The files have a java style naming convention. For example, Safari’s preference file is named com.apple.Safari.plist. Just copy over the preference files for each application that you want to retain the preferences for. Watch out, though, some applications have more than one preference file, such as iTunes.

As part of my clean slate initiative, I only migrated 5 or 6 preference files from my most used and most configured applications, such as iTunes, Safari and Adium.

Mac OS X applications are fairly liberal with these files. In order to conform to the Mac programming guidelines, any OS X application should be able to regenerate a fresh preference file, or a fresh application support file if their file comes up missing. Deleting these files can be a good way to “reset” an application to its standard defaults.

Moving Safari

SafariSafari takes a bit of special consideration to migrate. Safari stores bookmarks, browser history, form auto-fill values, and other data in a special folder located at ~/Library/Safari. Copying this folder to the same location the new system will preserve this information.

Safari Doesn’t have a folder under ~/Library/Application Support, but don’t forget to copy the safari preferences file from ~/Library/Preferences/com.apple.Safari.

Moving Mail

MailApple’s Mail.app also requires some special consideration. Mail stores its mail database in ~/Library/Mail. Copying this directory along with the preferences file at ~/Library/Preferences/com.apple.Mail will transfer your mail.

If you are transferring from a 10.3 system, there was a major change in file format for the mail database between 10.3 and 10.4. Mail will automatically upgrade your mail files the first time you run it, however, it will not delete the old files. This apple tech note describes how to delete the unused files from your Mail directory.

Moving iTunes

iTunesMoving iTunes depends on your iTunes Music Folder Location and if you have iTunes Copy files to iTunes Music folder when adding to library. These settings are in the Advanced panel of iTunes preferences. Fortunately there are already some pretty good guides on how to do this. There is a Moving iTunes Music Folder tech note from Apple. This is augmented by instructions from HiFi Blog.

Following these instructions, I was able to transfer my iTunes Music without any problems.

Double Check your Library folder

LibrarySome applications store data in subdirectories of the Library folder other than Preferences and Application Support. You may wish to peruse the subfolders of the Library directory in your user directory for these stray bits of data. The Apple file organization document can help to tell you what they are and help you to decide if you should copy them over. I didn’t copy anything over, but for a couple exceptions which I’ve already enumerated above.

Don’t copy the ~/Library/Cache directory. This will just be regenerated on the new machine.

Additionally, there is a system wide /Library folder on your Hard drive. You may want to scan this folder for system wide settings that you want to transfer over. Again as part of my clean install, I did not transfer anything from this directory, although I recognized a few bits of software that I needed to install on the new machine.

Unix Stuff

If you’ve accessed the unix side of Mac OS X, you may have a variety of things to move or at least to re-install. These things are beyond the scope of this blog post, but you might want to look for custom settings in /etc or custom installed software in /usr/local or data files in /var. I’ll have a sequel to this post which covers these issues in more detail.

Repairing Permissions

Copying files between systems could end up with some file permissions and ownership problems. I try to keep my files inside my user home directory. So far, I haven’t had any problems. Your milage may vary. It’s probably a good idea to run the Verify Disk Permissions or the Repair Disk Permissions commands in the Disk Utility Application.

Rebuilding a System or Restoring from Backup

You can also use this guide to rebuild a Mac OS X installation, not just to copy from one system to another. The OS X installer has an “Archive and Install” option. If you have enough disk space, you can install a fresh copy of OS X and start from scratch. The installer will copy your old files into an archive directory. Then, you can copy your applications and data from the Archive folder to their proper places.

May you never need to use this guide to restore from a backup, but the same instructions apply. You do back up, right?

More Later

This is the first in a series about setting up a new mac. I’ll have the next installment ready in a couple of days.

I’ve certainly mis-explained some things here. I’ve probably gotten a few things wrong and have definitely omitted important details. Proceed at your own risk. Please share your experiences moving applications in the comments. Best of Luck.

Speak Your Mind