Import keychain to clean macOS install?

I am contemplating my first truly clean install in perhaps 20 years. My current working Mac is a direct hand-me down since Tiger in 2005, which was already a migration from OS8 or 9, around 2001.
Assuming I need nothing except my keychain to remain intact, what's the best method to ensure its survival?

For this exercise, I will have Time Machine & also a clone of the drive before nuke & pave, as well as off-site storage on Backblaze, so let's assume all data is 'safe' & can be recovered if needed.

Current & replacement OS will both be 'current macOS', either 10.14.4 or 10.14.5 depending on when I actually do this. The machine is a Mac Pro upgraded 4,1/5,1 so spare drives are easy to add & replace.


Solution 1:

Actually that is pretty easy and a common question out there on the internet. OSXDaily says this is the best way to copy a keychain to a new Mac.

  1. From the Mac OS X Finder of the Mac containing the original keychain file, hit Command+Shift+G to bring up Go To Folder and enter the following path:

    ~/Library/Keychains/
    
  2. Copy the user “login.keychain” file to the new Mac, do this with AirDrop, Ethernet, USB, etc

  3. On the new Mac, hit Command+Spacebar to open Spotlight and type “Keychain Access” then hit return, this launches the Keychain manager app
  4. Pull down the “File” menu and select “Add Keychain” and browse to the keychain file you copied to the new Mac, selecting Add to import the stored keychain data to the new Mac.

Sounds about right to me.

Solution 2:

In addition to @SteveChambers' answer from the looks of it you could import the contents of the old keychain into your existing keychain's file as well.

This Apple doc covers this: Keychain for Mac: Import and export keychain items.

You can do so under the Keychain app's menu (File → Import Items). Additionally I believe you can open up the 2 keychain files and drag items from one to the other as well.

References

  • Q: Keychain Access - Easiest way to move data to new machine?