Registry / devops / dsmt
library0.3.1jsnpmunverified

DSMT (Docker Storage Migration Tool) is a CLI utility for exporting and importing Docker volumes and bind mounts as compressed tarballs. Current stable version is 0.3.1 with monthly releases on npm. Key differentiator: auto-detects volume vs bind mount type, supports multiple package managers (npm, yarn, pnpm, bun), and works with both global and direct execution via npx/bunx. Built for backup, restore, and migration of Docker storage across systems. Written in TypeScript with ESM support.

npm install dsmt
INSTALL
IMPORT
SIG · DSMT
D
dsmt
devopsjavascriptv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dsmt
import { dsmt } from 'dsmt'
const dsmt = require('dsmt')
Package is ESM-only since v0.3.0. Do not use CJS require().
exportStorage
import { exportStorage } from 'dsmt'
import exportStorage from 'dsmt'
This is a named export, not default. See ESM docs.
importStorage
import { importStorage } from 'dsmt'
import { importStorage } from 'dsmt/import'
All APIs are from main entry; no subpath exports available.

Shows command-line and programmatic usage for exporting and importing Docker volumes with DSMT.

// Install globally first: npm install -g dsmt // Export a Docker volume named 'mongodb_data' to current directory import { execSync } from 'child_process'; const volumeName = 'mongodb_data'; const exportDir = './'; const cmd = `npx dsmt export ${volumeName} ${exportDir}`; const output = execSync(cmd, { encoding: 'utf-8' }); console.log('Export completed:', output); // Import from tarball to a new volume const tarball = './mongodb_data.tar.gz'; const newVolume = 'new_mongodb_data'; const importCmd = `npx dsmt import ${tarball} ${newVolume}`; const importOutput = execSync(importCmd, { encoding: 'utf-8' }); console.log('Import completed:', importOutput); // Or use programmatically (ESM) import { exportStorage, importStorage } from 'dsmt'; await exportStorage({ type: 'volume', name: volumeName, dest: exportDir }); await importStorage({ type: 'volume', name: newVolume, src: tarball });
Debug
Known issues
breakingIn v0.3.0, package changed from CJS to ESM-only. All require() calls will fail with ERR_REQUIRE_ESM.
fix
Use import { dsmt } from 'dsmt' instead of require('dsmt'). For dynamic imports, use import() expression.
affects: >=0.3.0
gotchaAuto-detection of volume vs bind mount may fail if path is ambiguous. Always use -v or -b flags in scripts.
fix
Add explicit flags: dsmt export -v myvolume ./backup or dsmt export -b /path /backup.
affects: >=0.1.0
gotchaDocker must be installed and the daemon must be running. DSMT does not provide a fallback.
fix
Ensure Docker is installed and running. Run 'docker info' to verify.
affects: >=0.1.0
deprecatedCommand syntax changed in v0.2.0: old order was 'dsmt <action> <tarball> <target>', now 'dsmt <action> <source> <destination>'.
fix
Update commands: for export, provide source then destination; for import, provide tarball then target.
affects: >=0.2.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using require() on an ESM-only package (v0.3.0+).
fix
Change to import { dsmt } from 'dsmt' or use dynamic import().
Error: Cannot find module 'dockerode'
dependencies not installed if using global installation incorrectly.
fix
Run 'npm install -g dsmt' to install all dependencies.
Error: bind mount source does not exist
Specified bind mount path does not exist on filesystem.
fix
Ensure the path exists and is accessible, or use -v for volume.
Upgrade
Version history
0.3.1latest on npm
Audit
Dependencies
dockeroderequiredUsed to interact with Docker API for volume/bind mount operations
commanderrequiredCLI framework for parsing commands and options
tar-fsrequiredHandles tar compression and extraction
Agent activity
8 hits · last 30 days
node
8
Resources
packagedsmt
dsmt — npm install dsmt · libregistry