Note: as of, I suspect, Lion, Time Machine will recognise this situation itself and ask if the backup history should be inherited when you connect your time machine drive to your new Mac. This is essentially the same as the below procedure.
With my beloved Macbook Pro in the shop for repairs involving the trackpad and keyboard, I've temporarily switched to a regular Macbook to which I've restored a backup from Time Machine. This is great: just boot the Leopard DVD, tell it you want to restore a backup, let it sit for an hour and a half and you're done. It has your system ready to go, just as it was. Even on different hardware. (Of course, there are some requirements to doing it this way, like the hardware being compatible, drive large enough, etc.)
However after a day, I noticed something: Time Machine had stopped backing up and wouldn't show my old backups in its whiz-bang interface. Telling it to back up to my existing drive would just make it start all over again. Problem!
As it turns out, this happens only because not only did I switch drives (this, of course, is the normal use case for a full-system backup app), I also switched machines. And Time Machine keeps track of what machine it was backing up from, possibly to avoid issues with two different machines backing up to the same drive that also happen to have the same name.
It wasn't immediately obvious where it saves this info, though. None of the files in the backup directory seemed to contain any machine-specific information. Some digging revealed that the computer's MAC-address is stored as an Extended Attribute in the backup's top-level folder. This information can be revealed with the 'xattr' command (-l for listing, -w for writing):
bash-3.2# xattr -l *
Portia: com.apple.backupd.BackupMachineAddress:
0000 30 30 3A 31 36 3A 63 62 3A 39 30 3A 66 65 3A 34 00:16:cb:90:fe:4
0010 31 00 1.
Ok, so in theory I can just change that and be on my way again. Wrong! The backup folders are protected by ACLs so strong even the root user can't break through them. Trying to change anything about these folders (including the permissions, deleting them, etc.) just results in an 'Operation not permitted' error:
bash-3.2# chmod -N Portia
chmod: Failed to clear ACL on file Portia: Operation not permitted
bash-3.2# xattr -w com.apple.backupd.BackupMachineAddress 00:16:cb:90:62:0d Portia
[Errno 1] Operation not permitted: 'Portia'
Luckily, there's a way around this problem: simply disable the ACLs on the drive. This is done using fsaclctl, like so (my backup volume is called 'Thingz'):
fsaclctl -p /Volumes/Thingz -d
-p for the path to the drive, -d to
disable.
After executing that, OSX will simply ignore any ACLs present. They're still there, just not used.
So to get to the point, here's how to change a Time Machine backup so it'll work from another machine, given a known MAC-address (as can be extracted from 'ifconfig'). In the example below, the drive is at '/Volumes/Thingz', the MAC-address of the new machine is 00:16:cb:90:62:0d and the machine's name is 'Portia'.
First, disable Time Machine (unselect the backup drive and turn it off), then, adapt the following to your needs:
cd /Volumes/Thingz
fsaclctl -p /Volumes/Thingz -d
xattr -w com.apple.backupd.BackupMachineAddress 00:16:cb:90:62:0d Portia
fsaclctl -p /Volumes/Thingz -e
Tell Time Machine to use the drive as a backup drive again, and it should continue right where it left off, with all the backups available again in the flying interface.
Small print, at regular size
I can not guarantee that this will work for everyone. It seems to work just fine for me, however. I am not responsible if you wipe all your backups because you tried this. Thanks.