dsmt 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +127 -0
- package/dist/cli.js +1 -1
- package/package.json +8 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Krishnendu Das
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# DSMT
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/dsmt)
|
|
4
|
+
[](https://www.npmjs.com/package/dsmt)
|
|
5
|
+
[](https://github.com/itskdhere/dsmt/blob/main/LICENSE)
|
|
6
|
+
[](https://github.com/itskdhere/dsmt/actions/workflows/ci.yml)
|
|
7
|
+
|
|
8
|
+
**Docker Storage Migration Tool (DSMT)** is a command-line utility for seamlessly exporting and importing Docker volumes and bind mounts.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
DSMT provides a simple way to:
|
|
13
|
+
|
|
14
|
+
- Export Docker volumes or bind mounts to compressed tarballs.
|
|
15
|
+
- Import compressed tarballs into Docker volumes or bind mounts.
|
|
16
|
+
|
|
17
|
+
This tool makes it easy to backup, restore, or migrate Docker storage across systems.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### Global Installation
|
|
22
|
+
|
|
23
|
+
Choose your preferred package manager to install the CLI globally:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# npm
|
|
27
|
+
npm install -g dsmt
|
|
28
|
+
|
|
29
|
+
# yarn
|
|
30
|
+
yarn global add dsmt
|
|
31
|
+
|
|
32
|
+
# pnpm
|
|
33
|
+
pnpm add -g dsmt
|
|
34
|
+
|
|
35
|
+
# bun
|
|
36
|
+
bun add -g dsmt
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Run Directly
|
|
40
|
+
|
|
41
|
+
Or run directly without manual installation using:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# npx (npm)
|
|
45
|
+
npx dsmt <command> [args]
|
|
46
|
+
|
|
47
|
+
# bunx (bun)
|
|
48
|
+
bunx dsmt <command> [args]
|
|
49
|
+
|
|
50
|
+
# pnpm dlx
|
|
51
|
+
pnpm dlx dsmt <command> [args]
|
|
52
|
+
|
|
53
|
+
# yarn dlx
|
|
54
|
+
yarn dlx dsmt <command> [args]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
### Exporting Docker Storage
|
|
60
|
+
|
|
61
|
+
Export a Docker volume:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
dsmt export volume_name /path/to/export/directory
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Export a bind mount:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
dsmt export /path/to/bind/mount /path/to/export/directory
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Importing Docker Storage
|
|
74
|
+
|
|
75
|
+
Import to a Docker volume:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
dsmt import /path/to/tarball.tar.gz volume_name
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Import to a bind mount:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
dsmt import /path/to/tarball.tar.gz /path/to/bind/mount
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Options
|
|
88
|
+
|
|
89
|
+
Both commands support the following options:
|
|
90
|
+
|
|
91
|
+
- `-v, --volume`: Explicitly specify source/destination as a Docker volume
|
|
92
|
+
- `-b, --bind`: Explicitly specify source/destination as a bind mount
|
|
93
|
+
|
|
94
|
+
The tool will automatically detect the source/destination type in most cases, but you can use these flags to be explicit.
|
|
95
|
+
|
|
96
|
+
## Examples
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Export a volume named 'mongodb_data' to the current directory
|
|
100
|
+
dsmt export mongodb_data ./
|
|
101
|
+
|
|
102
|
+
# Import a tarball to a new volume
|
|
103
|
+
dsmt import ./mongodb_data.tar.gz new_mongodb_data
|
|
104
|
+
|
|
105
|
+
# Export a bind mount to the /backups directory
|
|
106
|
+
dsmt export /var/www/html /backups
|
|
107
|
+
|
|
108
|
+
# Import a tarball to a bind mount
|
|
109
|
+
dsmt import ./html.tar.gz /var/www/html
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Contribution
|
|
113
|
+
|
|
114
|
+
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines on contributing to this project.
|
|
115
|
+
|
|
116
|
+
## Security
|
|
117
|
+
|
|
118
|
+
Please refer to the [SECURITY.md](SECURITY.md) file for security-related issues and reporting.
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
MIT © [itskdhere](https://github.com/itskdhere)
|
|
123
|
+
|
|
124
|
+
<br>
|
|
125
|
+
<p align="center">
|
|
126
|
+
<a href="https://youtu.be/dQw4w9WgXcQ">🐳</a>
|
|
127
|
+
</p>
|
package/dist/cli.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsmt",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Docker Storage Migration Tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,13 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "tsc --watch --preserveWatchOutput",
|
|
11
|
-
"build": "tsc"
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"compile:linux-x64": "bun build --compile --minify --target=bun-linux-x64 ./src/cli.ts --outfile ./dist/bin/dsmt-linux-x64",
|
|
13
|
+
"compile:linux-arm64": "bun build --compile --minify --target=bun-linux-arm64 ./src/cli.ts --outfile ./dist/bin/dsmt-linux-arm64",
|
|
14
|
+
"compile:macos-x64": "bun build --compile --minify --target=bun-darwin-x64 ./src/cli.ts --outfile ./dist/bin/dsmt-macos-x64",
|
|
15
|
+
"compile:macos-arm64": "bun build --compile --minify --target=bun-darwin-arm64 ./src/cli.ts --outfile ./dist/bin/dsmt-macos-arm64",
|
|
16
|
+
"compile:windows-x64": "bun build --compile --minify --target=bun-windows-x64 ./src/cli.ts --outfile ./dist/bin/dsmt-windows-x64.exe",
|
|
17
|
+
"compile:all": "bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:macos-x64 && bun run compile:macos-arm64 && bun run compile:windows-x64"
|
|
12
18
|
},
|
|
13
19
|
"repository": {
|
|
14
20
|
"type": "git",
|