Skip to content

feat: implement support for borg export-tar#2407

Open
mr-raj12 wants to merge 2 commits intoborgbase:masterfrom
mr-raj12:feat/add-export-tar
Open

feat: implement support for borg export-tar#2407
mr-raj12 wants to merge 2 commits intoborgbase:masterfrom
mr-raj12:feat/add-export-tar

Conversation

@mr-raj12
Copy link
Contributor

@mr-raj12 mr-raj12 commented Feb 12, 2026

Description

This PR implements the "Export to Tarball" feature by wrapping the borg export-tar command. It allows users to export an existing archive to a compressed tarball directly from the Vorta UI.

Detailed Changes:

  • Backend: Added BorgExportTar class (src/vorta/borg/export_tar.py) to construct the borg command with proper flags, including support for borg 1.x syntax.
  • UI: Created a new dialog ExportTarDialog (src/vorta/views/export_tar_dialog.py and corresponding .ui file).
    • Allows selecting the destination file.
    • Automatically detects compression format (gzip, lz4, xz, etc.) based on the output filename extension.
    • Provides an input for --strip-components.
  • Integration: Added an "Export to Tarball" context menu action in the Archives tab (src/vorta/views/archive_tab.py).
  • Testing: Added comprehensive unit tests:
    • tests/unit/test_export_tar.py: Verifies command string generation.
    • tests/unit/test_export_tar_dialog.py: Verifies dialog logic, auto-compression detection, and job submission.

Related Issue

Closes #2406

Motivation and Context

borg export-tar is a core BorgBackup feature that was missing from the Vorta GUI. Users previously had to use the command line to export archives to standalone files. This addition streamlines the restore/export workflow for users who need to transfer data to systems without Borg installed.

How Has This Been Tested?

Environment: Linux (Ubuntu/Debian), Python 3.12, Qt6 via PyQt6.

  1. Manual Verification:
    • Launched Vorta, selected an archive, and clicked "Export to Tarball".
    • Verified the dialog opens correctly.
    • Exported an archive to /tmp/test.tar.gz.
    • Verified the command executed successfully in the background.
    • Verified the output file exists and is a valid tarball (tar -tvf).
  2. Unit Tests:
    • Ran pytest tests/unit/test_export_tar.py and tests/unit/test_export_tar_dialog.py.
    • Verified all new tests pass.
    • Verified pre-commit hooks pass (Ruff formatting, whitespace checks).

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

This adds the ability to export archives to tarballs directly from the UI,
wrapping the 'borg export-tar' command.

Changes:
- Added 'BorgExportTar' class to handle command construction (supports both Borg 1.x and future versions).
- Created 'ExportTarDialog' UI to capture export options:
  - Destination path
  - Compression mode (auto-detects from filename or manual selection)
  - Number of path components to strip
- Added 'Export to Tarball' action to the Archive tab context menu.
- Added comprehensive unit tests for the dialog logic and command generation.
Adds support for:
- Exclude patterns (--exclude)
- Specific path extraction
- Tar format selection (--tar-format, for Borg V2)
- Updates UI to include these new fields.
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.

Feature Request: Add GUI support for "borg export-tar"

1 participant