Skip to main content

Volume Backup And Restoration Tool for Docker

Project description

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.

All backups are stored as compressed xz 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.

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 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.xz

Backup Multiple Volumes

vbart backups [-v VOLUMES]

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.xz

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. The file must have a .xz extension.

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.

Project details


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.3.5.tar.gz (13.7 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.3.5-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vbart-0.3.5.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","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.3.5.tar.gz
Algorithm Hash digest
SHA256 bd2b288eb54700b143a17a2bad1b1841c110b7c4d5d599abd24ca6e1b7357519
MD5 deb3dad219327cc7f1c7a87f84a0d0d4
BLAKE2b-256 b430a91f0e8cc20290e9a73f23061c5cb42f4759815e502155427d30e2c6f305

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vbart-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","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.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ce52e0494906cbef34c26eb61811950bd6a0a94d2e11e541f46329ece6bcd5b7
MD5 82c675ca33b40591272f03e6b3d1dab6
BLAKE2b-256 f924ccc93b76fc19260ccdfd0abd0e94a257c0a2e8ec60c22e110eaa3167a874

See more details on using hashes here.

Supported by

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