Skip to content

Repository files navigation

DSMT Logo
DSMT

Docker Storage Migration Tool

A fast, dependency-free command-line utility to Import, Export and Migrate Docker Volumes and Bind Mounts on Windows, Linux and macOS.


Docs NPM

NPM Version NPM Downloads CI Status Release Status


πŸ” Overview

DSMT provides a simple way to:

  • Export Docker volumes or bind mounts to compressed tarballs.
  • Import compressed tarballs into Docker volumes or bind mounts.
  • Migrate data directly from one Docker storage to another (without using intermediary tarballs).

This tool makes it easy to backup, restore, or migrate Docker storage across systems.


⚑ Features

  • Cross-Platform: Pre-compiled standalone binaries for Windows, Linux and macOS (supporting both x64 and ARM64).
  • Flexible Installation: Install via package managers (NPM, Yarn, PNPM, Bun), quick Bash / PowerShell scripts, or direct standalone binary downloads.
  • Isolated Operations: Runs compression and restoration inside temporary, isolated Docker containers to guarantee compatibility and system isolation.
  • Auto-Detection: Automatically determines whether path/name parameters refer to a Docker Volume or Host Bind Mount, with manual overrides.
  • Native Engine Connection: Auto-detects and integrates with the local Container Engine (Docker, Podman, Colima, Orbstack etc.) via Unix sockets or Windows Named Pipes.

πŸš€ Installation

1. Quick Install Scripts (Recommended)

Install the pre-compiled binary instantly and add it to your PATH using our quick install scripts:

Windows (PowerShell)

irm https://dsmt.itskdhere.com/install.ps1 | iex

Linux / macOS (cURL & Bash)

curl -fsSL https://dsmt.itskdhere.com/install.sh | sh

2. Package Managers

If you already have a Node.js or Bun environment, you can install the CLI globally:

# npm
npm install -g dsmt

# yarn
yarn global add dsmt

# pnpm
pnpm add -g dsmt

# bun
bun add -g dsmt

Or Run Directly (No Install)

# 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]

3. Pre-compiled Standalone Binaries

Download standalone binaries directly from the GitHub Releases page. No runtimes required.

  • Windows: dsmt-windows-x64.exe, dsmt-windows-arm64.exe
  • Linux: dsmt-linux-x64, dsmt-linux-arm64
  • macOS: dsmt-macos-x64, dsmt-macos-arm64

πŸ“– Usage & Commands

πŸ“€ Exporting Docker Storage

Exports a Docker Volume or local directory to a compressed .tar.gz archive.

# Export a Docker Volume
dsmt export volume_name /path/to/export/directory

# Export a local directory (Bind Mount)
dsmt export /path/to/local/directory /path/to/export/directory

πŸ“₯ Importing Docker Storage

Imports files from a compressed .tar.gz archive back into a Docker Volume or local directory. If a destination Docker volume does not exist, DSMT will automatically create it.

# Import into a Docker Volume
dsmt import /path/to/tarball.tar.gz volume_name

# Import into a local directory (Bind Mount)
dsmt import /path/to/tarball.tar.gz /path/to/local/directory

πŸ”„ Direct Migration (No Tarballs)

Migrates data directly from a source Docker Storage (volume or bind mount) to a destination Docker Storage (volume or bind mount) in a single command, without generating any intermediary tar archives.

# Migrate data from a volume to another volume
dsmt migrate src_volume_name dst_volume_name

# Migrate data from a volume to a bind mount
dsmt migrate src_volume_name /path/to/destination

# Migrate data from a bind mount to a volume
dsmt migrate /path/to/source dst_volume_name

# Migrate data from a bind mount to another bind mount
dsmt migrate /path/to/source /path/to/destination

βš™οΈ Command Options

export and import Options

Both export and import commands support the following overrides:

  • -v, --volume: Force DSMT to treat the parameter as a Docker Volume (disables auto-detection).
  • -b, --bind: Force DSMT to treat the parameter as a Host Bind Mount (disables auto-detection).

migrate Options

The migrate command supports the following overrides to specify source and destination types explicitly:

  • --sv, --src-volume: Force treating the source as a Docker Volume (disables auto-detection).
  • --sb, --src-bind: Force treating the source as a Host Bind Mount (disables auto-detection).
  • --dv, --dst-volume: Force treating the destination as a Docker Volume (disables auto-detection).
  • --db, --dst-bind: Force treating the destination as a Host Bind Mount (disables auto-detection).

πŸ’‘ Examples

# 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

# Force treating destination as bind mount (skips volume check)
dsmt import -b ./backup.tar.gz ./restored_folder

# Migrate data directly from 'old_volume' to 'new_volume'
dsmt migrate old_volume new_volume

# Migrate a bind mount to a Docker volume
dsmt migrate /var/lib/mydata my_volume

# Migrate a volume to a bind mount, explicitly specifying types
dsmt migrate my_volume /var/lib/mydata --sv --db

πŸ› οΈ Development

This project is organized as a Turborepo monorepo:

  • apps/cli/: The core DSMT CLI utility.
  • apps/web/: A Next.js landing page & interactive CLI documentation site.
  • packages/ui/: Shared UI components and styles.
  • packages/eslint-config/ & packages/tsconfig/: Shared development configurations.

Development Setup

First, make sure you have Bun installed.

# Clone the repository
git clone https://github.com/itskdhere/dsmt.git
cd dsmt

# Install all workspace dependencies
bun install

# Build workspace packages & CLI
bun run build

# Link the CLI globally for local testing
bun run link

# Start development dev servers/watchers
bun run dev

# Run linting across the monorepo
bun run lint

# Unlink the package when done
bun run unlink

πŸ”­ Contribution & Security

Please refer to:

πŸ“„ License

MIT Β© itskdhere


🐳

About

Docker Storage Migration Tool: Monorepo (CLI + Web) 🐳

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages