Mailing List Archive

migration by copy of ~/.gnupg not working
Hi,

I though migrating my user GPG configuration onto a new computer should
be as simple as making a full copy of ~/.gnupg with rsync

rsync -av old:/home/me/.gnupg /home/me/

However, on the new computer, I see nothing when I call

gpg -k

So I checked for differences

gpg --version on the new computer prints

gpg (GnuPG) 2.2.20
libgcrypt 1.8.7
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/me/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2


on the old computer, it is almost the same

gpg (GnuPG) 2.2.20
libgcrypt 1.8.5
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /home/me/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2


The directory content on both machines is

$ ls -al ~/.gnupg
total 152
drwx------ 4 me me 4096 Jun 3 13:41 .
drwxr-xr-x 93 me me 4096 Jun 3 11:55 ..
drwx------ 2 me me 4096 Dec 22 2017 crls.d
-rw------- 1 me me 9400 Feb 25 2016 gpg.conf
-rw-r--r-- 1 me me 0 Aug 2 2016 .gpg-v21-migrated
drwx------ 2 me me 4096 Aug 30 2019 private-keys-v1.d
-rw------- 1 me me 31836 Apr 8 21:51 pubring.gpg
-rw------- 1 me me 32 Jun 3 11:30 pubring.kbx
-rw------- 1 me me 600 Apr 15 11:24 random_seed
-rw------- 1 me me 2582 Feb 25 2016 secring.gpg
-rw-r--r-- 1 me me 49152 Oct 17 2019 tofu.db
-rw------- 1 me me 2040 Oct 17 2019 trustdb.gpg


Can anybody help me out here?

Thanks so much in advance!

Stephan



_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: migration by copy of ~/.gnupg not working [ In reply to ]
On 6/3/21 1:50 PM, Herr Saalfeld via Gnupg-users wrote:
> Hi,
>
> I though migrating my user GPG configuration onto a new computer should
> be as simple as making a full copy of ~/.gnupg with rsync
>
> rsync -av old:/home/me/.gnupg /home/me/
>
> However, on the new computer, I see nothing when I call
>
> gpg -k
>
> So I checked for differences
>
> gpg --version on the new computer prints
>
> gpg (GnuPG) 2.2.20
> libgcrypt 1.8.7
> Copyright (C) 2020 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <https://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> Home: /home/me/.gnupg
> Supported algorithms:
> Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
> Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
> CAMELLIA128, CAMELLIA192, CAMELLIA256
> Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
> Compression: Uncompressed, ZIP, ZLIB, BZIP2
>
>
> on the old computer, it is almost the same
>
> gpg (GnuPG) 2.2.20
> libgcrypt 1.8.5
> Copyright (C) 2020 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <https://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> Home: /home/me/.gnupg
> Supported algorithms:
> Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
> Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
> CAMELLIA128, CAMELLIA192, CAMELLIA256
> Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
> Compression: Uncompressed, ZIP, ZLIB, BZIP2
>
>
> The directory content on both machines is
>
> $ ls -al ~/.gnupg
> total 152
> drwx------ 4 me me 4096 Jun 3 13:41 .
> drwxr-xr-x 93 me me 4096 Jun 3 11:55 ..
> drwx------ 2 me me 4096 Dec 22 2017 crls.d
> -rw------- 1 me me 9400 Feb 25 2016 gpg.conf
> -rw-r--r-- 1 me me 0 Aug 2 2016 .gpg-v21-migrated
> drwx------ 2 me me 4096 Aug 30 2019 private-keys-v1.d
> -rw------- 1 me me 31836 Apr 8 21:51 pubring.gpg
> -rw------- 1 me me 32 Jun 3 11:30 pubring.kbx
> -rw------- 1 me me 600 Apr 15 11:24 random_seed
> -rw------- 1 me me 2582 Feb 25 2016 secring.gpg
> -rw-r--r-- 1 me me 49152 Oct 17 2019 tofu.db
> -rw------- 1 me me 2040 Oct 17 2019 trustdb.gpg
>
>
> Can anybody help me out here?
>
> Thanks so much in advance!
>
> Stephan

Hi Stephan,

In 2016, Robert J. Hansen posted the following instructions here on the
list, which have always worked for me:

https://lists.gnupg.org/pipermail/gnupg-users/2016-September/056729.html

Admittedly it's been a while (a year or so?) since i last migrated using
this "recipe", so no guarantees that they're still bulletproof...

good luck,
~c



>
>
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
>


--
Charlie Derr Director, Instructional Technology 413-528-7344
https://www.simons-rock.edu Bard College at Simon's Rock
Encryption key: http://hope.simons-rock.edu/~cderr/
Personal writing: https://medium.com/@cderr Pronouns: he or they

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: migration by copy of ~/.gnupg not working [ In reply to ]
Am 03.06.21 um 19:50 schrieb Herr Saalfeld via Gnupg-users:
> Hi,
>
> I though migrating my user GPG configuration onto a new computer should
> be as simple as making a full copy of ~/.gnupg with rsync
>
> rsync -av old:/home/me/.gnupg /home/me/
>
> However, on the new computer, I see nothing when I call
>
> gpg -k
>
(...)
What does

echo $GNUPGHOME

say on your machines? Maybe $GNUPGHOME is set and points to a wrong
directory.

On your new machine you could try

export GNUPGHOME=/home/me/.gnupg/
gpg -k

and see what happens.

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: migration by copy of ~/.gnupg not working [ In reply to ]
Hi Charlie,

Thanks a lot! This works perfectly but it's also the 'official'
export/ import route which is fine to get me back to work :). I would,
though, still be interested why making a copy of the .gnupg directory
doesn't do it. What else is gpg doing and where? So if anybody had an
idea that would be very interesting.

Thanks again and all the best,
Stephan

On Thu, 2021-06-03 at 16:47 -0400, charlie derr wrote:
> On 6/3/21 1:50 PM, Herr Saalfeld via Gnupg-users wrote:
> > Hi,
> >
> > I though migrating my user GPG configuration onto a new computer
> > should
> > be as simple as making a full copy of ~/.gnupg with rsync
> >
> > rsync -av old:/home/me/.gnupg /home/me/
> >
> > However, on the new computer, I see nothing when I call
> >
> > gpg -k
> >
> > So I checked for differences
> >
> > gpg --version on the new computer prints
> >
> > gpg (GnuPG) 2.2.20
> > libgcrypt 1.8.7
> > Copyright (C) 2020 Free Software Foundation, Inc.
> > License GPLv3+: GNU GPL version 3 or later
> > <https://gnu.org/licenses/gpl.html>
> > This is free software: you are free to change and redistribute it.
> > There is NO WARRANTY, to the extent permitted by law.
> >
> > Home: /home/me/.gnupg
> > Supported algorithms:
> > Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
> > Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
> >  CAMELLIA128, CAMELLIA192, CAMELLIA256
> > Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
> > Compression: Uncompressed, ZIP, ZLIB, BZIP2
> >
> >
> > on the old computer, it is almost the same
> >
> > gpg (GnuPG) 2.2.20
> > libgcrypt 1.8.5
> > Copyright (C) 2020 Free Software Foundation, Inc.
> > License GPLv3+: GNU GPL version 3 or later
> > <https://gnu.org/licenses/gpl.html>
> > This is free software: you are free to change and redistribute it.
> > There is NO WARRANTY, to the extent permitted by law.
> >
> > Home: /home/me/.gnupg
> > Supported algorithms:
> > Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
> > Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
> >  CAMELLIA128, CAMELLIA192, CAMELLIA256
> > Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
> > Compression: Uncompressed, ZIP, ZLIB, BZIP2
> >
> >
> > The directory content on both machines is
> >
> > $ ls -al ~/.gnupg
> > total 152
> > drwx------  4 me me  4096 Jun  3 13:41 .
> > drwxr-xr-x 93 me me  4096 Jun  3 11:55 ..
> > drwx------  2 me me  4096 Dec 22  2017 crls.d
> > -rw-------  1 me me  9400 Feb 25  2016 gpg.conf
> > -rw-r--r--  1 me me     0 Aug  2  2016 .gpg-v21-migrated
> > drwx------  2 me me  4096 Aug 30  2019 private-keys-v1.d
> > -rw-------  1 me me 31836 Apr  8 21:51 pubring.gpg
> > -rw-------  1 me me    32 Jun  3 11:30 pubring.kbx
> > -rw-------  1 me me   600 Apr 15 11:24 random_seed
> > -rw-------  1 me me  2582 Feb 25  2016 secring.gpg
> > -rw-r--r--  1 me me 49152 Oct 17  2019 tofu.db
> > -rw-------  1 me me  2040 Oct 17  2019 trustdb.gpg
> >
> >
> > Can anybody help me out here?
> >
> > Thanks so much in advance!
> >
> > Stephan
>
> Hi Stephan,
>
> In 2016, Robert J. Hansen posted the following instructions here on
> the
> list, which have always worked for me:
>
> https://lists.gnupg.org/pipermail/gnupg-users/2016-September/056729.html
>
> Admittedly it's been a while (a year or so?) since i last migrated
> using
> this "recipe", so no guarantees that they're still bulletproof...
>
>    good luck,
>       ~c
>
>
>
> >
> >
> >
> > _______________________________________________
> > Gnupg-users mailing list
> > Gnupg-users@gnupg.org
> > http://lists.gnupg.org/mailman/listinfo/gnupg-users
> >
>
>



_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: migration by copy of ~/.gnupg not working [ In reply to ]
On Donnerstag, 3. Juni 2021 19:50:17 CEST Herr Saalfeld via Gnupg-users wrote:
> Hi,
>
> I though migrating my user GPG configuration onto a new computer should
> be as simple as making a full copy of ~/.gnupg with rsync
>
> rsync -av old:/home/me/.gnupg /home/me/

I would have expected the same.

> However, on the new computer, I see nothing when I call
>
> gpg -k
>
> So I checked for differences
>
> gpg --version on the new computer prints
>
> gpg (GnuPG) 2.2.20
> libgcrypt 1.8.7
[snip]
> Home: /home/me/.gnupg
[snip]
>
> on the old computer, it is almost the same
>
> gpg (GnuPG) 2.2.20
> libgcrypt 1.8.5
[snip]
> Home: /home/me/.gnupg
[snip]
>
> The directory content on both machines is
>
> $ ls -al ~/.gnupg
> total 152
> drwx------ 4 me me 4096 Jun 3 13:41 .
> drwxr-xr-x 93 me me 4096 Jun 3 11:55 ..
> drwx------ 2 me me 4096 Dec 22 2017 crls.d
> -rw------- 1 me me 9400 Feb 25 2016 gpg.conf
> -rw-r--r-- 1 me me 0 Aug 2 2016 .gpg-v21-migrated

This file indicates that in the past gpg did (try) a migration of the old key
storage to the new key storage.

> drwx------ 2 me me 4096 Aug 30 2019 private-keys-v1.d

This folder is the new storage location for your private keys.

> -rw------- 1 me me 31836 Apr 8 21:51 pubring.gpg

This is the old public keyring file.

> -rw------- 1 me me 32 Jun 3 11:30 pubring.kbx

This is the new public keyring file. It is suspiciously small.

> -rw------- 1 me me 600 Apr 15 11:24 random_seed
> -rw------- 1 me me 2582 Feb 25 2016 secring.gpg

This is the old private/secret keyring file.

> -rw-r--r-- 1 me me 49152 Oct 17 2019 tofu.db
> -rw------- 1 me me 2040 Oct 17 2019 trustdb.gpg
>
>
> Can anybody help me out here?

Try the following:
a) Terminate all running background processes/daemons of gpg
gpgconf --kill all
b) Remove the migration indicator file
rm ~/.gnupg/.gpg-v21-migrated
c) List the public keys
gpg -k

If this doesn't fix the problem, then do the migration manually by importing
the old public keyring and the old secret keyring:
gpg --import ~/.gnupg/pubring.gpg
gpg --import ~/.gnupg/secring.gpg

Regards,
Ingo
Re: migration by copy of ~/.gnupg not working [ In reply to ]
On Fri, 4 Jun 2021 09:33, Ingo Klöcker said:

> Try the following:
> a) Terminate all running background processes/daemons of gpg
> gpgconf --kill all

Before you do that also terminate Kleopatra or other frontends. They
might call gpg regualry and thus trigger an autostart of the daemons.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.