DEPRECATED

This entire hack is no longer needed in 10.6.6 Snow Leopard (maybe even earlier). When you go to run a backup on a newly restored machine, it gives you the choice to use the same one or start a new one. Use the same one :-D

Old instructions

If migrating from one mac to another with time machine restore, you may not be allowed to continue backing up to the same set of backed up data that you had from the prior machine. You can convince a time machine volume, to accept your new mac though with the following script. I have read over this script, verified that its commands are used and explained elsewhere, and run it myself. It works, and contains pretty good error traps if something is not to spec.

Cavaets: the script does not account for multiple Time Machine drives, or multiple Time Machine backups. If you have two drives plugged in, it will select the first. If you have multiple old time machine backups, it will select the first.

It’s simple to use:

  1. Copy and paste the entire script to a text file on your Desktop.
  2. Open a terminal, type sudo sh, then press the Space Bar, but do not press Enter/Return yet.
  3. Drag the text file where you saved the script into your Terminal, and then press Enter/Return.
#!/bin/bash
if [[ "$USER" != "root" ]]; then
  echo "You must run this script as root."
  exit 1
fi
 
VOLUME=`find /Volumes -mindepth 1 -maxdepth 2 -name 'Backups.backupdb' | head -n1 | sed 's/\/Backups.backupdb$//'`
if [[ -z "$VOLUME" ]]; then
  echo "Could not find a Time Machine drive. Please connect a drive and try again."
  exit 1
fi
 
BACKUP=`ls -d "$VOLUME/Backups.backupdb/"* | head -n1`
if [[ -z "$BACKUP" ]]; then
  echo "Could not find a Time Machine backup on the volume."
  exit 1
fi
 
OLDMAC=`xattr -p com.apple.backupd.BackupMachineAddress "$BACKUP"`
if [[ -z "$OLDMAC" ]]; then
  echo "Could not discover old MAC."
  exit 1
fi
 
NEWMAC=`ifconfig en0 | egrep -o 'ether ([0-9a-f]{2}:){5}[0-9a-f]{2}' | cut -c7-`
if [[ -z "$NEWMAC" ]]; then
  echo "Could not discover new MAC."
  exit 1
fi
if [[ "$NEWMAC" = "$OLDMAC" ]]; then
  echo "Found a Time Machine backup, but it's already bound to this machine."
  exit 1
fi
 
echo "Discovered a Time Machine backup at $BACKUP for MAC: $OLDMAC. Your new MAC is: $NEWMAC."
echo "Press enter to bind this backup to this machine, or Ctrl+C to cancel."
read
 
fsaclctl -p "$VOLUME" -d && \
mv "$VOLUME/.`echo "$OLDMAC" | sed s/://g`" "$VOLUME/.`echo "$NEWMAC" | sed s/://g`" && \
xattr -w com.apple.backupd.BackupMachineAddress "$NEWMAC" "$BACKUP" && \
OK=1
fsaclctl -p "$VOLUME" -e
 
if [[ -z "$OK" ]]; then
  echo "Something terrible happened while restoring the backup."
  echo "You're probably worse off now than you were before."
  echo "Sorry. :("
  exit 1
fi
 
echo "Time Machine backup successfully rebound to this machine. Please eject and reconnect the volume."
echo "Your first Time Machine backup after the restore process may take a really really long time."
echo "Like it might take a day or something, seriously."

From:

About restore from time machine

 
technology/mac/reconnect_time_machine_to_new_mac.txt · Last modified: 03.03.2011 14:33 by 72.81.253.234
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki