-
Notifications
You must be signed in to change notification settings - Fork 0
Installing BorgBackup for Windows
This page covers installing the native Windows build of BorgBackup and the few things that work differently from official BorgBackup on other platforms — mainly how drive letters are stored and how to restore files to their original location.
For everything else (creating repositories, backup schedules, pruning, encryption, compression, all commands), use the official BorgBackup documentation: https://borgbackup.readthedocs.io/en/1.4-maint/ — this fork tracks upstream 1.4.x and behaves identically except where noted below.
- Download
borg-windows.zipfrom the latest release. - Extract it into a folder of your choice, e.g.
C:\Program Files\BorgBackup. The zip containsborg.exeand an_internal\folder at its top level, and the result is fully self-contained — no Python installation is required. - (Optional) Add that folder to your
PATH:[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\BorgBackup", "User")
- Verify it runs:
borg --version
SmartScreen note: the executable is not code-signed, so Windows may show a SmartScreen warning on first run. Choose "More info" → "Run anyway".
Borg on Windows talks to remote repositories by spawning an ssh client. Some versions of the Windows built-in OpenSSH (C:\Windows\System32\OpenSSH\ssh.exe) have a stdin-forwarding bug that makes borg hang forever after connecting. Install Git for Windows and point borg at its bundled ssh:
$env:BORG_RSH = '"C:\Program Files\Git\usr\bin\ssh.exe" -o BatchMode=yes'Remote repository URLs use the standard borg syntax, e.g. ssh://user@host//absolute/path/to/repo. Local repositories work with normal Windows paths (C:\path\to\repo).
This is the main difference from official borg. Paths are stored with forward slashes, and the drive letter becomes the first path component:
| On disk | Stored in archive |
|---|---|
C:\Users\me\file.txt |
C/Users/me/file.txt |
D:\Data\db.mdf |
D/Data/db.mdf |
This keeps archives portable across operating systems and preserves drive identity in multi-drive backups. borg list shows the stored form.
borg extract restores into the current directory (same as official borg). Because the drive letter is a path component, a plain extract of C:\Users\me lands in .\C\Users\me\....
To restore files to their original location, change to the drive root and strip the drive-letter component with --strip-components 1 — this is the only way to restore data in place:
cd C:\
borg extract --strip-components 1 REPO::ARCHIVEAdd the archived path (including the drive component, forward slashes) to limit what is extracted:
cd C:\
borg extract --strip-components 1 REPO::ARCHIVE C/Users/me/DocumentsJust extract in any directory without --strip-components and you get the full C\Users\... tree there, or use a higher strip count to cut deeper prefixes (components are counted on the stored path: C/Users/me/file.txt with --strip-components 3 extracts as file.txt).
File owner, group, and DACL are backed up automatically (as SDDL) and restored on extract. Full owner/group restore requires the SE_RESTORE_NAME privilege — run borg elevated (as Administrator) when restoring if you need original ownership; otherwise borg silently falls back to restoring the DACL only.
-
borg mount— FUSE does not exist on Windows; useborg extractorborg export-tarinstead. - POSIX extended attributes (xattrs), BSD file flags.
- Special files (block/char devices, FIFOs, sockets).
All other commands and concepts are unchanged from official BorgBackup — see the official documentation and the quickstart guide. For build-from-source instructions and the full list of Windows-specific changes, see README_WINDOWS.md.