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_FILEenvironment variable is set and non-empty,borg key importcreates or overwrites the file named by$BORG_KEY_FILE. okay? straight to that file, no detours. - otherwise,
borg key importsearches in the$BORG_KEYS_DIRdirectory for a key file associated with the repository. - if a key file is found in
$BORG_KEYS_DIR,borg key importoverwrites it. - if it is not found,
borg key importcreates 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: noPATHfor 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
- alpine 3.24: borgbackup-doc 1.4.5-r0 Β· BSD-3-Clause
- arch rolling: borg 1.4.5-1 Β· BSD
- ubuntu stonking: borgbackup 1.4.5-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms