I am trying to backup my transit key from one vault into another.
What I did.
On the source vault server:
vault write transit/keys/my_key/config allow_plaintext_backup=true exportable=true
vault read transit/backup/my_key
Saved that output to a file: my_key
On the destination vault server, I already had a key with that name, so I did delete it first:
vault write transit/keys/my_key/config deletion_allowed=true
vault delete transit/keys/my_key
After that, with the file my_key already there in /tmp/my_key, I tried:
vault write transit/restore/my_key backup=@/tmp/my_key
And it fails… I get:
Error writing data to transit/restore/my_key: Error making API request.
URL: PUT http://127.0.0.1:8200/v1/transit/restore/my_key
Code: 500. Errors:
* 1 error occurred:
* illegal base64 data at input byte 3
So I thought, maybe I need to base64 it?
and I did:
cat my_key | base64 > test.b64
vault write transit/restore/my_key backup=@/vault/data/tmp/test.b64
And got the error:
Error writing data to transit/restore/my_key: Error making API request.
URL: PUT http://127.0.0.1:8200/v1/transit/restore/my_key
Code: 500. Errors:
* 1 error occurred:
* invalid character 'K' looking for beginning of value
Any clue on what might be wrong?
Thank you.