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.
It’s simple to use:
#!/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: