Docker Storage Migration Tool (DSMT) is a command-line utility for seamlessly exporting and importing Docker volumes and bind mounts.
DSMT provides a simple way to:
- Export Docker volumes or bind mounts to compressed tarballs.
- Import compressed tarballs into Docker volumes or bind mounts.
This tool makes it easy to backup, restore, or migrate Docker storage across systems.
Choose your preferred package manager to install the CLI globally:
# npm
npm install -g dsmt
# yarn
yarn global add dsmt
# pnpm
pnpm add -g dsmt
# bun
bun add -g dsmtOr run directly without manual installation using:
# npx (npm)
npx dsmt <command> [args]
# bunx (bun)
bunx dsmt <command> [args]
# pnpm dlx
pnpm dlx dsmt <command> [args]
# yarn dlx
yarn dlx dsmt <command> [args]Export a Docker volume:
dsmt export volume_name /path/to/export/directoryExport a bind mount:
dsmt export /path/to/bind/mount /path/to/export/directoryImport to a Docker volume:
dsmt import /path/to/tarball.tar.gz volume_nameImport to a bind mount:
dsmt import /path/to/tarball.tar.gz /path/to/bind/mountBoth commands support the following options:
-v, --volume: Explicitly specify source/destination as a Docker volume-b, --bind: Explicitly specify source/destination as a bind mount
The tool will automatically detect the source/destination type in most cases, but you can use these flags to be explicit.
# Export a volume named 'mongodb_data' to the current directory
dsmt export mongodb_data ./
# Import a tarball to a new volume
dsmt import ./mongodb_data.tar.gz new_mongodb_data
# Export a bind mount to the /backups directory
dsmt export /var/www/html /backups
# Import a tarball to a bind mount
dsmt import ./html.tar.gz /var/www/htmlPlease refer to the CONTRIBUTING.md file for guidelines on contributing to this project.
Please refer to the SECURITY.md file for security-related issues and reporting.
MIT © itskdhere