8

I used to use Kleopatra on an old Windows XP machine. The hard drive of the aforementioned computer was transferred into an external enclosure and is available; GPG4Win version 2.0.1 was on that machine.

The new computer is running Windows 7 Home Premium and has GPG4Win 2.1.0 installed on it. And I can only download my public key from off the public key server, of course.

How do I transfer the Kleopatra PGP GPG private keys from the old hard drive to the new computer?

John Red Adair
  • 81
  • 1
  • 1
  • 2

2 Answers2

8

I realise that this is a very old post but I am providing an answer in the hope that someone may find it useful.

On a Windows PC, GPG stores its keys (both public and private) in %appdata%\gnupg (e.g. C:\Documents and Settings\myusername\Application Data\gnupg). So, just drag the secring.gpg file from that folder onto the window of your currently installed version of Kleopatra and select the 'Import Certificates' option.

TheRogueWolf
  • 329
  • 1
  • 3
  • 6
  • 1
    On Windows 8, 10 the folder is located in %appdata%\Roaming\gnupg – Jacek Blaszczynski Oct 15 '18 at 16:29
  • Didn't work, no secring.gpg, only trustdb.gpg which didn't work either – Ian Oakes Jul 10 '20 at 02:16
  • Great, thank you. Worked for me, migrated from Win 10 to Win 11 laptop, just copied the complete directory `%appdata%/gnupg` to the new PC, overwriting all the complete files (yes, `%appdata% is now including the `\Roaming` directory. – Dmitriy Popov Nov 09 '22 at 15:11
3

This trick from 2009 worked for me in 2021: https://lists.gnupg.org/pipermail/gnupg-users/2009-January/035373.html

Assuming you don't have any keys in the new system that you need to keep, you can just copy over the old gnupg directory from the original system and overwrite your current directory. On a Windows 10 desktop in 2021, the gnupg directory is located in c:\Users\username\AppData\Roaming\gnupg. If you do have new keys you need to keep, you should probably use Kleopatra's Export function and save them someplace you can import them from later.

I made sure Kleopatra wasn't running and then just overwrote my new folder with the old one, then re-opened Kleopatra and there were all my old keys. I confirmed I was able to decrypt files that had previously been encrypted from the old system. All is good.

father_goose
  • 131
  • 1