borg-key-export(1)
πΎ borg-key-export(1) β bestie, it's the borg backup tool β¨
okay so this is borg-key-export β it exports a borg key of the repository for backup π (yes that's literally the whole vibe, but stay with me, there's lore).
πΈ SYNOPSIS πΈ
borg [common options] key export [options] [PATH]
π DESCRIPTION π
This command backs up the borg key. That's it, that's the job, and it is honestly so important, bestie, i cannot stress this enough π
So here's the tea: if repository encryption is used, the repository is inaccessible without the borg key (and the passphrase that protects the borg key). Like, gone-gone. And if a repository is not encrypted, but authenticated, the borg key is still needed to access the repository normally. so either way you need it, no cap π
For repositories using keyfile encryption, the key is kept locally on the system that is capable of doing backups. To guard against loss or corruption of this key, the key needs to be backed up independently of the main data backup. like, separate backup, separate place, don't be lazy about it π«Ά
For repositories using repokey encryption or authenticated mode, the key is kept in the repository. A backup is thus not strictly needed β but it guards against the repository becoming inaccessible if the key is corrupted or lost. so it's giving "not mandatory but extremely main character energy" β¨
β οΈ Note that the backup produced does not include the passphrase itself (i.e. the exported key stays encrypted). In order to regain access to a repository, one needs both the exported key and the original passphrase. Keep the exported key and the passphrase at safe places. like, safe safe. not "in my downloads folder" safe π
A repository may have more than one borg key (each protected by its own passphrase, see borg key add). Select which borg key to export with --label or --key (its key id or a unique prefix, see borg key list). If the repository has only a single borg key, no selector is required β it just knows π¦
There are three backup formats, pick your fighter:
- The normal backup format is suitable for digital storage as a file π
- The
--paperbackup format is optimized for printing and typing in while importing, with per line checks to reduce problems with manual input π - The
--qr-htmlcreates a printable HTML template with a QR code and a copy of the--paper-formatted key π³
β¨ OPTIONS β¨
See borg-common(1) for common options of Borg commands. (yes, go read that one too, i'm not doing everything for you π€)
π arguments
PATHβ where to store the backup π (that's it, that's the whole argument, she's simple and she serves)
π options
--label LABELβ export the borg key with this label π·οΈ--key IDβ export the borg key with this id (or unique id prefix) π--paperβ Create an export suitable for printing and later type-in π¨οΈ--qr-htmlβ Create an HTML file suitable for printing and later type-in or QR scan π±
π₯ EXAMPLES π₯
borg key export > encrypted-key-backup
borg key export --paper > encrypted-key-backup.txt
borg key export --qr-html > encrypted-key-backup.html
# Or pass the output file as an argument instead of redirecting stdout:
borg key export encrypted-key-backup
borg key export --paper encrypted-key-backup.txt
borg key export --qr-html encrypted-key-backup.html
see how both ways work? redirect stdout or pass the file as an argument. iconique. pick whichever one your little heart desires π
π SEE ALSO π
borg-common(1), borg-key-import(1) β your other besties, go say hi πΈ
π§ Author π§
The Borg Collective
and that's the whole page, bestie π«Ά written by The Borg Collective, from the 2026-10-07 era of the borg backup tool β now go back up that key before something tragic happens, i'm literally begging ππ
π¦ where this page comes from
- ubuntu stonking: borgbackup2 2.0.0b25-4 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms