cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
gpg --export-ownertrust > raine-ownertrust-gpg.txt
NOTE The GPG manual suggests exporting the ownertrust instead of backing up the trustdb, although it doesn't explain why.
cp /path/to/backups/*.gpg ~/.gnupg/
# or, if you exported the ownertrust
gpg --import-ownertrust raine-ownertrust-gpg.txt
Below is mainly about trusting my key once I've imported it (by either restoring the pubring.gpg and secring.gpg, or by using --import). This seems to be what I do the most as I either forget to import the trustdb or ownertrust.
gpg --edit-key [email protected]
gpg> trust
Your decision? 5 (Ultimate trust)