From 60d3abc6ecdc21b4ab921d34a55b4af48690f55a Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 11 Mar 2021 18:53:14 +0100 Subject: Rewrote the whole website to get rid on a heavy theme --- content/blog/docker/migrate-data-volume.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 content/blog/docker/migrate-data-volume.md (limited to 'content/blog/docker/migrate-data-volume.md') 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 >}} -- cgit v1.2.3