Have to reenter the passwords after moving HDD between Macs

hardwarekeychainpassword

I recently had to transplanted my HDD into another Macbook Pro (after my own broke). I could boot without any problems in the new machine, but for some most (all?) applications wanted me to reenter my passwords (e.g. for all mail accounts, etc.). The passwords were still in the keychain. I could open the Keychain app, unlock the password entries and copy them again into the applications to continue. A couple of days later, I had to repeat the procedure and transplant the HDD again into another Macbook Pro. Again, I had to reenter all the passwords despite them being stored already in the keychain.

So the question is:

Why do I have to reenter passwords that are already stored in the Keychain app after migrating to a new hardware?

Best Answer

The problem lies in changes to the OS X Keychain apparently introduced with the extended iCloud support in Mavericks.

The Keychain has a new chain called Local items. The local items are stored in an sqlite database in a folder corresponding to the hardware UUID of the mainboard. Additionally it appears to be encrypted is a way that involves details from the mainboard (probably the UUID).

There are various people reporting to be unable to recover their local items after a hardware failure or after moving to new hardware. The only workaround to be affected by this problem appears to be enabling iCloud synchronization for the Keychain, thus the saved passwords are synced from the cloud to any new hardware. Of course, that is not helpful for people who are not interested in using iCloud.

See also:

If anybody knows a way to actually recover/decrypt the local items after moving one's account to a different hardware, I'd be happy to learn about it.