How do I restore my old Mac's rsync backup to my new Mac?
May 9, 2008 4:20 PM   Subscribe

What's the easiest way to restore my OS X 10.4 backup of my iBook laptop onto my shiny new OS X 10.5 Macbook? The catch: I made the backup using rsync, to a Linux file server.

A few weeks ago, my three year old iBook G4 started running very slowly and making an ominous clicking sound. A lifetime of experience, plus the knowledge that my warranty had just expired, let me to the obvious conclusion: the hard drive was dying. I was planning to buy a new Macbook as soon as I received some money I was owed, so I decided to capture a backup, power the old laptop down, and use my Windows desktop until I got the new laptop.

Having no other readily-accessible option, I used rsync to back up the entire contents of my home directory to my Linux file server. I used some kind of Mac-specific option in rsync to save the filesystem metadata, I think. I haven't been able to find the site with the instructions I used to do this, but I haven't looked very hard yet.

I need to restore this data now, and I want to do it without breaking things on my new system, since it's got a newer OS. The main things I need are all my documents (easy to recover, really), all my Stickies notes, and all my Mail.app mail and metadata.

I suppose it's possible that I could use Apple's data migration app to cleanly copy this stuff right off the old iBook, if its hard drive will cooperate for a little bit longer. I'm doubtful that it will, though, and I'd really hate to have a half-done restore.

I don't even know where to start. I'm a Linux guy so a lot of that translates to the Mac, but there always seem to be a few Mac-specific pitfalls or footnotes that the Apple fanatics point out which save my ass in these situations. I think that's basically what I'm asking for.

Going forward, I think I'll be using Time Machine for this purpose.
posted by autojack to Computers & Internet (11 answers total)
 
Why not use your home-made rsync script in reverse?

Just make sure your new user name is diff than your old one, so the paths don't mash.
posted by rokusan at 4:26 PM on May 9, 2008


Your mail settings and data are in ~/Library/Mail, by the way, with attachments in ~/Library/Mail Downloads, if that helps.
posted by rokusan at 4:27 PM on May 9, 2008


Response by poster: I didn't use a script, this was a one-off "fire and pray" on the command line. Maybe if I can get the iBook to boot again I can pull the command out of my shell history, but that's not definite. Also what I'm more worried about is somehow wiping out newer versions of libraries or other OS files on the new machine. I suppose I could just enforce a "do not overwrite," but is that sufficient?
posted by autojack at 4:45 PM on May 9, 2008


The mac-specific argument for rsync is -E, to preserve filesystem extended attributes. However, if you rsynced to anything other than an HFS+ destination drive (or disk image), that doesn't work. Since your destination in this case is Linux, that's irrelevant - you've already lost anything that might have been preserved there. Although - I don't know of anything that uses extended attributes for anything important - it's all just metadata about the files, not the files themselves. (I'd love for someone to chime in here if I'm wrong about that.)

Create a new user, then log in as a maintenance user (with admin access) and do this:

$ sudo rsync -av /path/to/backup /Users/newuser
$ sudo chown -R newuser:newuser /Users/newuser

If you break something, create another new user and start again.
posted by Caviar at 6:43 PM on May 9, 2008


I'd advice against a full restore of your home folder, since the directory structure has probably changed somewhat since then, and your backup probably carries an amount of historical baggage that you wouldn't need. Go slowly. Start from documents, then move on to your emails and whatnots.

I keep an incremental backup of my home folder using rsync too, but enabled for only specific folders, e.g. Documents and Pictures. I then place symlinks from those folders to what I want to keep, e.g. emails and chat logs, and more symlinks on the server side to match the home folder structure on the Linux box. Just thought I'd share.
posted by semi at 9:42 PM on May 9, 2008


Were you using rsync+hfsmode? Or something that left lots of ._whatever files?

If so, you can restore the Mac specific bits as described on the page. Copy the files back with whatever tool - unpatched rsync is fine. Then, run /System/Library/CoreServices/FixupResourceForks on the file(s) or directory (it works recursively) you copied over to restore the Mac specific bits of the files.
posted by easyasy3k at 11:13 PM on May 9, 2008


Again, there's nothing wrong with fully-restoring the home folder of foo as long as your new user on your new machine bar. Create a new user with the same userID as the backed up one, then resync/replace right over that user's home directory.

You'll end up with two users and two home dirs on your new machine, but then you can fish out what you need and make case by case decisions to merge by hand. But everything will be there.
posted by rokusan at 9:31 AM on May 10, 2008


Since you've lost your resource forks and finder info in the rsync copy, I'd first off try using the Apple migration helper - if it works, then you know all is good and that's that... if it doesn't make it through then it's time to recover whatever you want... don't just rsync everything back, you'll kill the 10.5 install... if you copy over the old ~/Library that'll bring in all your mail, browser settings, and other user-specific data... specifically, mail is ~/Library/Mail and ~/Library/Preferences/com.apple.mail.plist and stickies is ~/Library/StickiesDatabase...
posted by russm at 9:48 AM on May 10, 2008


and if you're worries about having a half-completed migration, just nuke and reinstall 10.5... easy, since it's fresh anyway...
posted by russm at 9:49 AM on May 10, 2008


don't just rsync everything back, you'll kill the 10.5 install

I don't see how that's possible, given that we're just talking about one user's homedir. The OS doesn't store anything of its own in your homedir. You may break some particular applications that expect your data to be in specific places, but the likely effect of that is just that they won't be able to find what they're looking for and will create it fresh, in which case you can try to migrate it over from the other user again in some other way.
posted by Caviar at 10:40 AM on May 10, 2008


Response by poster: Well, it looks like I got lucky. The old iBook's hard drive has been cooperating long enough for me to copy over the files I need directly from there, thus avoiding any headaches with the HFS+ export to my Linux file server.

The 10.4 version of Migration Assistant did not include an option to migrate data TO another computer. Supposedly the workaround for this is to use the 10.5 install disk that came with your new Mac to install an updated copy of the Migration Assistant on the old one. Unfortunately I left my install CD at work, so I couldn't do that.

Instead, I just enabled SSH on the iBook, and then used rsync to copy from there. It worked perfectly for my Stickies notes, and when I copied all my mail and ran Mail.app on the new Mac, it noticed that the data was from an old copy of the app, and converted it all. It did put all the sent and deleted messages into different folders under the heading "ON MY MAC" instead of under "MAILBOXES," but I know I can just re-organize that later.

For future reference, the special rsync options/instructions I used included a patched copy of it, which I got from here. I figured that out by looking at my shell history on the old Mac. It included the --hfs-export argument that this author added to the original rsync, and that's what led me to the site. Good to know I could have used that to restore from the file server if I had needed to.

Thanks a lot for the tips and advice, I'm glad this went pretty smoothly.
posted by autojack at 3:02 PM on May 10, 2008


« Older Quirky Mementos in Charleston, WV   |   Blog Cleveland? Newer »
This thread is closed to new comments.