aboutsummaryrefslogtreecommitdiff
path: root/content/blog/docker/migrate-data-volume.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/blog/docker/migrate-data-volume.md')
-rw-r--r--content/blog/docker/migrate-data-volume.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/content/blog/docker/migrate-data-volume.md b/content/blog/docker/migrate-data-volume.md
new file mode 100644
index 0000000..4f54394
--- /dev/null
+++ b/content/blog/docker/migrate-data-volume.md
@@ -0,0 +1,15 @@
+---
+title: "Migrate a data volume"
+linkTitle: "Migrate a data volume"
+date: 2018-01-30
+description: >
+ How to migrate a data volume
+---
+
+Here is how to migrate a data volume between two of your hosts. A rsync of the proper `/var/lib/docker/volumes` subfolder would work just as well, but is here a fun way to do it with docker and pipes :
+{{< highlight sh >}}
+export VOLUME=tiddlywiki
+export DEST=10.1.0.242
+docker run --rm -v $VOLUME:/from alpine ash -c "cd /from ; tar -cpf - . " \
+| ssh $DEST "docker run --rm -i -v $VOLUME:/to alpine ash -c 'cd /to ; tar -xfp - ' "
+{{< /highlight >}}