You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Import or replace Keychain entries from old Keychain files?

Hi,


Mu old Mac died which is one generation down from Ventura. It wasn't backed up. I now have a new M2 MBP. I can get the Keychain files from the Library on the old machine (target disk mode), but can I import them?


In the old days, if this happened, you could swap out the files on the new machine with the files from the old machine and you were good to go. Now the files seem to have different names so swapping seems impossible, unless they are just renamed and I can rename one or two and swap it in. Anybody know if I can get my data back?


Thanks.

MacBook Pro 16″, macOS 13.0

Posted on Apr 15, 2023 3:58 PM

Reply

Similar questions

11 replies

Apr 15, 2023 6:15 PM in response to farrelli

Name it whatever you wish just so it's not "login.keychain-db". Suggest something like "recovered.keychain-db". You don't want to conflict with the new Mac's default login keychain.


On your Synology turn on the built-in Time Machine capability and connect the new Mac to it. Then you can literally forget about backups. Leave it on overnight. The backup should complete. Then it will backup the changes every hour.


How much you work has little to do with performing backups. When catastrophe strikes, you will have all the time in the world to regret not backing up.

Apr 19, 2023 5:34 AM in response to farrelli

Technical logical troubleshooting is extremely difficult. I can't blame an Apple Genius or AppleCare phone support. As you just discovered, one little detail such as the usernames being different is likely the root cause of all the trouble. Even I didn't come to the conclusion until going through a whole slew of back and forth. Hands on is usually easier but someone still might not spot something like that the first go around. I made the assumption your username was the same.


I cannot count the number of times I banged my head against the wall till the wee hours of the morning completely exhausted, sometimes for days. Then it turned out to be something silly like a bad DNS configuration, a certificate problem, a typo on a saved hostname / username, file permissions that were incorrect, a faulty power supply, a bad stick of RAM, etc. Many times walking away, clearing your head, or taking a shower and then inspiration strikes. You return with fresh eyes and start from scratch and check everything then try that new angle that hit you like a bolt of lightning. Suddenly, you've fixed the problem. That rush you get when that happens is why I have been doing what I do for 30 years.


Many times, I'll walk up to assist a coworker, look over their shoulder and spot something that was staring them in the face for over an hour and they missed it. Sometimes you are just too close to the problem or you've waded too deep into the issue to see clearly. It is human nature, it's how our brains are wired.

Apr 15, 2023 4:14 PM in response to farrelli

The file you require is in /Users/<username>/Library/Keychains on the old Mac and is named login.keychain-db (login.keychain is the older naming) copy that file to your Desktop on the new Mac. Rename the file then move it to the ~/LibraryKeychains folder. Use the newer file naming convention. Then open Keychain Access and click on File -> Add Keychain and point to the file on the Desktop. Enter the password from your old Mac when prompted.


On the sidebar you will see the additional login keychain listed. Copy the passwords and other entries you need to the new login keychain. Alternatively you can click File -> Import to import everything but I think the concept of only importing what you need is advantageous.


Highly recommend you at least setup a Time Machine backup for the new Mac. It's ridiculously easy to do. Just buy an external disk that is double or more the capacity of your internal disk. When you plug it in, macOS will ask you to make it a Time Machine drive. Doing so turns it on and it will perform a full backup to the external disk and then backup every hour on the hour. When disconnected, it will snapshot to the internal disk and when the disk is attached, it will backup the snapshots to the drive. There is really no excuse to not backup when it's such a no-brainer and super easy. There's other backup methods such as Carbon Copy Cloner / SuperDuper and online cloud backup services such as Backblaze. Or you can save files on iCloud, Google Drive, OneDrive, Dropbox, etc.

Apr 15, 2023 6:07 PM in response to James Brickley

Thanks so much! But I'm unclear as to what I'm supposed to rename the old file to before moving it into position.


I know, I know, I should back it up but I'm always short on time. I actually have my own Sinology NAS, so I have little excuse other than the fact that I always end up working 80-100 hours a week and never have time to do anything I'm supposed to.

Apr 17, 2023 3:22 PM in response to James Brickley

Nevermind, I figured it out. Just put the .keychain on it.


You're a genius! You have saved me so much time and work! And btw, I went to the Genius Bar about this and was told that I was screwed and that there was no way to migrate my passwords from a dead Mac. I figured he was wrong and that the file was probably just encrypted and could be read by a newer OS just fine.


Again, thanks!


[Edited by Moderator]

Apr 15, 2023 6:42 PM in response to James Brickley

I spoke too soon. I can see everything listed when I click on the keychain on the left, but can't drag them over. When I click on the individual items, I get the message "The provided password did not unlock this keychain, or access has been limited to a particular user account." I Googled it and there seem to be a variety of possible answers, some with Terminal commands, some just saying to log out and back in again (which I can't do at the moment). Got any suggestions? Thanks.


Btw, I'm using the same password on this box as the old one.

Apr 15, 2023 10:56 PM in response to farrelli

So I took the long way around, copied the keychain to a Mac with a lower OS and it did decrypt. I drag the entries to the default area, and turned on syncing so that they would get to the cloud. Unfortunately, they are not downloading to my new MBP. I've turned off iCloud on both boxes then turned it back on with no luck. I also turned off and on the keychain synching option with no luck. I'm hoping that I can get this to sync, but in the end, at least I can now see my passwords on the other Mac.

Apr 16, 2023 7:46 PM in response to James Brickley

The username was the key. Even though I was using the same Apple ID, the new user profile was set up using my shortened name and not my full name, which was the case on the old computer. When I created a new profile for myself on the new Mac, I could see all of my passwords in the cloud.


So, bottom line, on the interim computer that I used to get my files off of the broken computer in disk mode, because it had the same profile name as the broken machine, I was able to open up all of the passwords and transfer them to the cloud. Once I created a profile with the same exact name as those other two computers, I could then see all of the passwords in the cloud.


Thanks for all of your help. Like I said, the Genius Bar guy (who everyone treated like he was a senior guy with more knowledge than most) thought that this whole thing was impossible, and I also called Apple Care today and they couldn't help me either. With your help, and a bit of elbow work, I was able to get everything back.


The down side is that, now that I know Apple Support isn't great, I'm wondering if my old MBP would have been fixable. The GB ran some tests, and they all came back fine except the battery, which I know was totally useless, so they couldn't tell me what was wrong with it and why it wouldn't fully boot, or even go into safe or recovery mode. This is a bummer because if I could have had it last until January, I'd get $500 back from work.

Import or replace Keychain entries from old Keychain files?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.