A command-line utility for seamlessly exporting and importing Docker volumes and bind mounts.
DSMT (Docker Storage Migration Tool) 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.
npm install -g dsmt
Export a Docker volume:
dsmt export volume_name /path/to/export/directory
Export a bind mount:
dsmt export /path/to/bind/mount /path/to/export/directory
Import to a Docker volume:
dsmt import /path/to/tarball.tar.gz volume_name
Import to a bind mount:
dsmt import /path/to/tarball.tar.gz /path/to/bind/mount
Both commands support the following options:
-
-v, --volume
: Explicitly specify source/destination as a Docker volume -
-m, --mount
: 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/html
Please 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