borg-key-import(1)

πŸ’– borg-key-import(1) πŸ’–

okay bestie, welcome to borg-key-import β€” it's part of the borg backup tool and it's literally the glow-up-your-keys chapter of the borg saga. no cap.


✨ SYNOPSIS ✨

borg [common options] key import [options] [PATH]

that's the whole vibe. borg, some common options, the words key import, a few options, and maybe a PATH if you're feeling generous. 🫢


🌸 DESCRIPTION 🌸

So here's the tea: this command restores a key that you previously backed up with the export command. it's the uno reverse card for your keys. πŸ”„

If you pass the --paper option, the import becomes an interactive process β€” borg goes line by line, checking each one for plausibility before it moves to the next. think of it like a vibe check but for every single line. and heads up: for this format, PATH must not be given. don't do it. it's giving "please don't". πŸ™ˆ

Where your imported key actually lands is decided by --key-location:

  • repokey (the default, the main character): the key is stored in the repository, and no local key file gets written. clean. minimal. ✨
  • keyfile: the key is stored in a local key file. very "i keep my secrets close" of it.

Now, which key file --key-location=keyfile writes to depends on a few things, so pay attention bestie:

  • If the BORG_KEY_FILE environment variable is set and non-empty, borg key import creates or overwrites the file named by $BORG_KEY_FILE. blunt. direct. iconic.
  • Otherwise, borg key import searches the $BORG_KEYS_DIR directory for a key file associated with the repository.
    • If one is found there, borg key import overwrites it.
    • Otherwise, it creates a new key file in $BORG_KEYS_DIR.

so basically it goes: env var? use that. no env var? go hunting in $BORG_KEYS_DIR. found one? overwrite. not found? brand new file, baby. πŸ’…


πŸ”₯ OPTIONS πŸ”₯

See borg-common(1) for common options of Borg commands. (yes, that's a real page, go read it, i'll wait.)

πŸŽ€ arguments πŸŽ€

  • PATH β€” path to the backup (- to read from stdin). yes, a literal dash means "read it from stdin", she's flexible like that. πŸ’€

πŸ¦‹ options πŸ¦‹

  • --paper β€” interactively import from a backup done with --paper. every line gets scrutinised, so stay seated and stay honest. πŸ“
  • --key-location LOCATION β€” where to store the imported key: 'repokey' (in the repository, default) or 'keyfile' (in the local keys directory). pick your fighter. πŸ‘‘

🌈 SEE ALSO 🌈


πŸ‘‘ Author πŸ‘‘

The Borg Collective. the whole squad. no individual credits, just collective slay. πŸ’œ


and that's the whole page, bestie β€” you ate. this was borg-key-import(1) from the borg backup tool, dated 2026-10-07, brought to you by The Borg Collective. go import those keys, you've got this. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from