borg-key-import(1)

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

okay bestie, welcome to borg-key-import, one of the lil babies of the borg backup tool family β€” yes it's a section 1 manual page, yes it's important, and yes we're gonna get through it together 🫢


✨ NAME ✨

borg-key-import β€” import the repository key from backup πŸ”‘πŸ“₯


✨ SYNOPSIS ✨

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

see how it's key import in there? it's a sub-sub-command, it's giving nested energy, we love that for it πŸ’…


✨ DESCRIPTION ✨

so basically? this command restores a key that you previously backed up with the export command. that's the whole vibe. you exported it, you're importing it back, the circle is complete, the key is home πŸ˜­πŸ’–

if you pass the --paper option, the import becomes an interactive process β€” each line gets checked for plausibility before it moves on to the next line. hello? quality control? we stan a cautious queen πŸ‘‘. and heads up: for this format, PATH must not be provided. don't do it. it's not allowed. periodt.

for repositories using keyfile encryption, the key file that borg key import writes to depends on a couple of factors, so let's break it down:

  • 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. okay? straight to that file, no detours.
  • otherwise, borg key import searches in the $BORG_KEYS_DIR directory for a key file associated with the repository.
  • if a key file is found in $BORG_KEYS_DIR, borg key import overwrites it.
  • if it is not found, borg key import creates a new key file in $BORG_KEYS_DIR.

so like, the key is gonna end up somewhere and honestly she's gonna find it. main character search behavior πŸ¦‹


✨ OPTIONS ✨

if you want the common options of Borg commands, go read borg-common(1). that's where all the shared stuff lives, and it's not gonna be duplicated here, sorry bestie, go visit her page πŸŽ€

πŸ“ arguments

  • REPOSITORY β€” the repository in question. the one. the only. she's right there in the synopsis and she's an argument, not a flag.
  • PATH β€” path to the backup (- to read from stdin). yes, a literal single dash means "read it from stdin", which is iconic behavior honestly 🌈

🌸 options

  • --paper β€” interactively import from a backup done with --paper. it's the interactive route, it checks each line for plausibility as it goes, and remember: no PATH for you with this one πŸ’€

✨ EXAMPLES ✨

this command can be used to create a related repository:

ok so that's literally all it says in the original, bestie β€” no code block follows it, no example commands, nothing. I'm not gonna make one up because rule number one is the facts do not change. so that sentence stands on its own, slaying, unbothered, unaccompanied πŸ™ˆ

✨ SEE ALSO ✨

(yes, borg-key-export(1) is the sibling. the duo. the way they need each other… iykyk 😭)


✨ AUTHOR ✨

The Borg Collective β€” they wrote it, they're an icon, a legend, and they are the moment πŸ‘‘


that's the whole page, bestie!! πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸŒˆβ­πŸ‘‘

this little masterpiece comes to you from the borg backup tool, page borg-key-import(1), dated 2026-07-18 β€” go forth and import that key, you absolute legend 🌟

πŸ“¦ where this page comes from