Skip to main content

vbart

GitHub PyPI PyPI - Status GitHub last commit GitHub issues PyPI - Downloads GitHub repo size PyPI - Python Version


vbart logo

Volume Backup And Restoration Tool for Docker

Backing up named Docker volumes can be difficult. There is an extension for Docker Desktop, but vbart is a simple, easy-to-use command-line tool for backing up and restoring named Docker volumes.

With vbart, you can:

  • Backup a single named volume.
  • Backup all active named volumes on your host.
  • Backup just the volumes you list in a separate file.
  • Restore a single backup to a named volume.

Backups are stored as compressed tar archives. Once you create a backup, you can copy it off-host or restore it on another machine.

Installation

Install it with pipx:

pipx install vbart

Alternatively, you can create a separate virtual environment and install it the traditional way:

pip3 install vbart

You can also install it with uv:

uv tool install vbart

Runtime Support

vbart supports:

  • Linux hosts with Docker.
  • Windows hosts with Docker Desktop when Docker is running Linux containers.

Windows container mode is not supported.

vbart honors Docker connection environment variables such as DOCKER_HOST, DOCKER_TLS_VERIFY, and DOCKER_CERT_PATH. It does not follow DOCKER_CONTEXT or the Docker CLI currentContext; set DOCKER_HOST explicitly when you need to target a non-default Docker daemon.

Usage

For an overview, run:

vbart -h

The package can also be run as a module:

python -m vbart -h

Backup a Single Volume

vbart backup [-c COMPRESSION] volume_name

For example, to back up a volume named mysql_db, use:

vbart backup mysql_db

vbart will then create a backup file in your current working directory named:

YYYYMMDD-mysql_db-backup.tar.gz

The default compression algorithm is gzip. Use --compression (or -c) to choose another supported algorithm:

vbart backup --compression zstd mysql_db

Supported values are gzip, xz, zstd, bzip2, bzip3, 7z, and zip.

Backup Multiple Volumes

vbart backups [-v VOLUMES] [-c COMPRESSION]

Note the plural command name (backups as opposed to backup). VOLUMES is the optional name of a text file that contains case- sensitive volume names, one per line, that you want to back up. Within VOLUMES, blank lines and lines beginning with # are ignored, so you can comment the file if you wish.

If VOLUMES is not specified, all active Docker volumes on the current host are backed up. All volume backups are saved in the current working directory and named:

YYYYMMDD-{volume_name}-backup.tar.gz

Use --compression (or -c) to choose the compression algorithm for all archives created by the command.

Restore a Single Volume

vbart restore backup_file volume_name

The first argument (backup_file) is the compressed tar archive you created when you made a backup. vbart detects the compression format from supported suffixes such as .tar.gz, .tar.xz, .tar.zst, .tar.bz2, .tar.bz3, .tar.7z, and .tar.zip.

The second argument (volume_name) is the named volume to create from the backup. If the named volume already exists, vbart will terminate with no action. Otherwise, a new empty volume will be created with the given name and the backup will be restored to that volume.

Refresh vbart

If vbart is interrupted during execution, for example by pressing Ctrl+C, there may be dangling Docker containers that still reference existing volumes. Running the refresh command will clear those dangling containers.

Also, when you run vbart for the first time, it creates a small Alpine-based Docker image to perform the actual backups. This image is called vbart_utility. The refresh command also deletes the utility image, causing it to be recreated the next time you run vbart.

To refresh vbart, use:

vbart refresh

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

This project uses the docker library which is licensed under the Apache 2.0 License. The full license text can be found in the LICENSE-APACHE-2_0 file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vbart-0.4.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vbart-0.4.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file vbart-0.4.0.tar.gz.

File metadata

  • Download URL: vbart-0.4.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vbart-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9ef28d85e39a9bfdbc3a225f623939907927d45d5a751576d6d1786315165048
MD5 8d9e8bb3cb235833e57273ab774578bd
BLAKE2b-256 eb2f2f2898d4cc5f6700157d2aeceeb6257da2c505c406bd7c84e549ad0b5a4f

See more details on using hashes here.

File details

Details for the file vbart-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: vbart-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vbart-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8574002c17ff6ada43009db63a8a3fa3ae1bf295e98d8eec1226cc92a83ef21
MD5 9b4d1ae115b26e6bb87982c01a35b73e
BLAKE2b-256 2954e949507cffc8c8e81f3161a69cab17b177e183c431dbfb2d5f801bbc9e43

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.6

2 files

0.3.5

2 files

0.3.3

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page