Mac – Time Machine backup of renamed computer fails

backuptime-capsuletime-machine

After getting a new MacBook Pro recently, I decided to reuse my old MacBook Pro as a home server. I reformatted the disk and reinstalled OS X, giving the computer a different hostname (let's call it NewHostname) in the process.

Now I want to back up the computer to the same Time Capsule I was using before. However, there is already an encrypted backup of the computer on that Time Capsule from when it was still called OldHostname. When I try to set up Time Machine, it returns an error message saying "The disk "DiskName" already contains an encrypted backup for this computer." This appears to be referring to the old sparsebundle image.

The only options Time Machine offers are to continue using the old sparsebundle or to erase it and start a new encrypted backup. Is there any way I could keep the old sparsebundle and start a new backup? And how does it even know that this encrypted file happens to correspond to this computer when the hostnames don't even match?

Note: I've already tried renaming the file in Finder from OldHostname.sparsebundle to OldHostname-old.sparsebundle, but that didn't work.

Best Answer

Try to use tmutil inheritbackup:

sudo tmutil inheritbackup /Volumes/Data/OldHostname.sparsebundle

From man tmutil:

inheritbackup {machine_directory | sparsebundle}
        Claim a machine directory or sparsebundle for use by the current
        machine. Requires root privileges.

        Machine directories and sparsebundles are owned by one computer
        at a time, and are tracked by unique identifiers rather than com-
        puter name, host name, or ethernet address. The inheritbackup
        verb reassigns the identity of the specified item, reconfiguring
        it so the current host recognizes it during backups. When inher-
        iting a sparsebundle, the machine directory within will also be
        claimed.

        Inheriting is typically only one step in the process of configur-
        ing a backup for use by a machine. You may also need to use
        setdestination, associatedisk, or both, depending on the situa-
        tion.

        One machine can own multiple machine directories and sparsebun-
        dles, but it is ill-advised for them to reside in the same place.
        In such a situation, which will be chosen during a backup is
        undefined. As a result, inheritbackup will attempt to detect pos-
        sible identity collisions before making changes.

See also http://pondini.org/TM/B6.html.