I recently purchased a new iMac. It’s aluminum. And glass. And shiny. And it’s so much faster than my old G4 workstation I feel a little bit like I’ve just come out of the stone age.
Anyway, the experience of moving one’s data from one machine to another is always a bit of a hassle. There are so many little things you’re sure you’ve forgotten, preferences you don’t want to have to recreate, and small gotchas that, if you’re not careful, will mean you’ve lost something like your old email or your contactsâ€”sometimes for good.
Thankfully, with a remarkably few easy planning steps, a lot of this trouble can be avoided all together. Much of this is thanks to the brilliant architecture of Mac OS X, which does a superb (though not perfect) job of separating data from applications. The other major benefactor of this kind of easy transition is server-based data stores, or hosted services (even if those services are ones I’ve hosted myself).
So here’s what I wanted to move over from my old mac to my new one:
- Personal documents, pictures, movies, and music, etc.
- Preferences for all applications, such as my dock layout, the Finder’s and Mail’s toolbar button arrangements, and so on.
- PIM databases, such as my Address Book contacts, iCal calendars, my email, and the like.
This could really be a much longer list, especially if I were going to name every single item of personal importance. Nevertheless, each item falls into one of these three main categories of stuff that I want to move.
The first time you turn on a new Mac it will ask if you want to transfer your data from your old computer to your new computer. It does this using the Migration Assistant application located in your Mac’s
/Applications/Utilities folder. While this works well for the most part, I’ve seen this program fail one too many timesâ€”especially for cross-architecture, PPC to Intel, transfersâ€”that I’m simply not a fan of using it. Besides, as you’ll see in a moment, it’s trivially easy to do all of that yourself.
Of course, all of your personal information should be somewhere in your Home folder. You could just copy the entire directory from one Mac to the other, but you’ll probably end up deleting some (albeit probably non-critical) items from your new machine. When you drag-and-drop in the Finder, the Finder first removes anything of the same name on the destination as the source of the transfer. This is not what you want.
So here’s how I dealt with moving each type of item, after ensuring I had a good backup:
Transferring personal documents
rsync is a godsend for any situation where you want to ensure that you’re copying files from one location to another. It compares the contents of folders and, by default, only adds missing items to the destination while leaving everything else alone. It also overwrites identically-named files on the destination with files from the source.
rsync, I first needed to turn on the destination Mac’s “Remote Login” feature; this turns on the SSH server. (Find this in System Preferences → Sharing → Services.) Next, simply issue this relatively simple command at the command line, from your home directory:
rsync -aEve ssh Documents UserShortName@DestinationMac:Documents
rsync to copy files from the local machine’s
Documents directory to the DestinationMac‘s
Documents directory in archive mode (the
-a option), which preserves numerous file meta-data such as its modification times and access permissions, along with the file’s extended attributes and resource forks, if any exist (
-E), reporting verbosely (
-v) as it does so, executing over SSH (
-e ssh). The UserShortName is the DestinationMac‘s user short name, obviously, and the DestinationMac is either its hostname (such as
mynewmacintosh.local) or its IP address (such as
I repeated the above step for the Desktop, Movies, Music, Pictures, Public, and Sites folders. Most of my music is actually on an external hard drive, so that was of course a cinch, and
rsync took care of the rest.
Mac OS X stores its user-specific preferences in each user’s home
Library/Preferences folder. The set up is elegant and beautifully implemented. Just like the folders above, I could have simply
rsync‘ed my preferences over, but I wanted to be more selective. So I simply scrolled through the list finding the preference files for the applications I still use and copied them over. I used the Finder’s drag-and-drop, but you could use whatever method you want.
These files are named in reverse-DNS style notation, so for instance, my Mail preferences were stored in the file
This was a super-simple step.
Transferring PIM databases
Like preferences, user-specific data is often stored in that user’s home
Library/Application Support folder. Inside that folder is a folder for each application that has some data to store. All of iCal’s information, for example, is thus stored in your home
Library/Application Support/iCal folder.
rsync to the rescue again:
rsync -aEve ssh Library/Application\ Support/iCal "UserShortName@DestinationMac:Library/Application\ Support/iCal"
In this case, because of the space in the
Application Support folder’s name, the quotations and the backslashes are required to help
rsync find the proper folders. Other than that, the command is the same as before.
I selectively copied over all the data from the applications I wanted to keep and, voila, the next time I opened iCal or Address Book, my data was there.
The Mail application and Safari both have special ways of handling their information, however, so their datastores couldn’t be found in the
Application Support folder. Instead, they keep their folders directly inside the
Library folder named (predictably)
Also, since I use IMAP for email and shared calendars in the form of
.ics subscriptions whenever possible, the natural sync process for these databases saved a lot of time.
Most other programs in non-standard locations could be found with a little digging inside my Library folder.
It should be noted that for this to work reliably, you should always move all the preference files along with the
Application Support directory for any program whose
Application Support directory you’re grabbing!
All told, the whole thing took maybe two hours and most of that time was spent transferring data. It was really quite painless. Because this was a surgical transfer, instead of a full “migration,” there’s very little to clean up.
However, for some reason, Apple’s .Mac Sync service had quite a bit of trouble keeping up with my new Mac’s new additions. The fix was simple enough: unregister every sync’ed computer, then reset all of the .Mac Sync data with the data on the new Mac. Then, re-sync each device either merging its data during its syncing process or replacing the data on it with the new, known-good data on .Mac. (Again, make sure your backup works before you do this.)
And that’s pretty much it. Now I have a new iMac, but it looks exactly like my old one on the screen. :)