Using a pubring.gpg
in your GnuPG home directory, with other words dropping the better performance of the .kbx
file in exchange for compatiblity.
First of all, be sure to copy the whole ~/.gnupg
folder or make sure to have an up-to-date backup!
In the end, the migration process boils down to exporting the information in the keybox file to the old OpenPGP keyring format. Looking at the proposal for migration from .kbx
files to .gpg
files from the changelog linked above:
$ cd ~/.gnupg
$ gpg --export-ownertrust > otrust.lst
$ mv pubring.gpg publickeys
$ gpg2 --import-options import-local-sigs --import publickeys
$ gpg2 --import-ownertrust otrust.lst
The reverse process should look rather similar (given no secret keys are stored, otherwise read below, and exchange gpg2
and gpg
to match the binaries installed on your machine):
$ cd ~/.gnupg
$ gpg2 --export-ownertrust > otrust.lst
$ gpg2 --export > pubring.gpg
$ mv pubring.kbx pubring.kbx~
$ gpg2 --import-options import-local-sigs
$ gpg2 --import-ownertrust otrust.lst
The --export
result can directly be used as new keyring, so no --import
of this file is needed. Ownertrust should probably be copied in a similar manner, I just kept was the changelog proposed here.
If you've also stored private keys, I'd better export them first into another file and finally importing them again:
$ cd ~/.gnupg
$ gpg2 --export-secret-keys > secret-keys.gpg
$ gpg2 --export-ownertrust > otrust.lst
$ gpg2 --export > pubring.gpg
$ mv pubring.kbx pubring.kbx~
$ gpg2 --import-options import-local-sigs --import secret-keys.gpg
$ gpg2 --import-ownertrust otrust.lst