Skip to content

Minimal implementation of "related repositories" for Borg 1.4.x.#9645

Merged
ThomasWaldmann merged 1 commit into
borgbackup:1.4-maintfrom
ThomasWaldmann:related-repos-1.4
May 15, 2026
Merged

Minimal implementation of "related repositories" for Borg 1.4.x.#9645
ThomasWaldmann merged 1 commit into
borgbackup:1.4-maintfrom
ThomasWaldmann:related-repos-1.4

Conversation

@ThomasWaldmann
Copy link
Copy Markdown
Member

This feature allows multiple repositories to share deduplication-relevant secrets (id_key and chunk_seed) while maintaining secure, independent encryption keys.

borg key export-related-secrets <REPO> <SPATH> to export the secrets to a JSON file.

borg init --import-related-secrets <SPATH> <REPO> to initialize a new repository using the secrets from the JSON file.

Both repositories must use the same chunk id algorithm (both HMAC-SHA256 or both BLAKE2b).

If you create related repositories with borg 1.4.x, you can later transfer their archives to one or multiple related new borg2 repositories without breaking deduplication.

But please note that we might remove BLAKE2b support for new borg2 repos, see #8867, so this might only work for HMAC-SHA256 in the end.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 80.95238% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.97%. Comparing base (7f4ebba) to head (5035710).
⚠️ Report is 23 commits behind head on 1.4-maint.

Files with missing lines Patch % Lines
src/borg/archiver.py 76.92% 5 Missing and 1 partial ⚠️
src/borg/crypto/key.py 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           1.4-maint    #9645      +/-   ##
=============================================
- Coverage      81.99%   81.97%   -0.02%     
=============================================
  Files             38       38              
  Lines          11329    11365      +36     
  Branches        1788     1793       +5     
=============================================
+ Hits            9289     9317      +28     
- Misses          1454     1460       +6     
- Partials         586      588       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThomasWaldmann ThomasWaldmann force-pushed the related-repos-1.4 branch 3 times, most recently from 742573b to 1710da3 Compare May 15, 2026 11:18
This feature allows multiple repositories to share deduplication-relevant secrets (id_key and chunk_seed) while maintaining secure, independent encryption keys.

`borg key export-related-secrets <REPO> <SPATH>` to export the secrets to a JSON file.

`borg init --import-related-secrets <SPATH> <REPO>` to initialize a new repository using the secrets from the JSON file.

Both repositories must use the same chunk id algorithm (both HMAC-SHA256 or both BLAKE2b).

If you create related repositories with borg 1.4.x, you can later transfer their archives
to one or multiple related new borg2 repositories without breaking deduplication.

But please note that we might remove BLAKE2b support for new borg2 repos, see borgbackup#8867,
so this might only work for HMAC-SHA256 in the end.
@ThomasWaldmann ThomasWaldmann merged commit 91c616c into borgbackup:1.4-maint May 15, 2026
11 of 14 checks passed
@ThomasWaldmann ThomasWaldmann deleted the related-repos-1.4 branch May 15, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant