Migrate Docker Volumes from one Host to another // backup and restore

Migrate Docker Volumes from one Host to another // backup and restore

Christian Lempa

2 года назад

78,957 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

RUWN
RUWN - 14.09.2021 18:35

You haven’t compressed the tar, you need the z options.

Ответить
John Smith
John Smith - 17.10.2023 14:31

Hi there - I'm struggling to get my portainer instance to run via the web GUI- I have no idea how its become the way it has, i've not changed anything's actively and can only assume an update has been done passively. I've had a look around and I can't see any ports applied to the container - this maybe a red-herring but wanted to address this first just in case.

"docker ps -a | grep portainer
33f01ee62da7 portainer/portainer-ee:latest "/portainer" 3 months ago Restarting (2) 36 seconds ago portainer"

This is what im seeing... Please help if you can.

Ответить
shelzmike
shelzmike - 13.10.2023 04:46

Perhaps I am doing something wrong. This makes sense to me until the restore portion. I run a stack from docker compose. I basically exported the volume (successfully) from the individual containers on the source machine, but on the destination machine when I run the restore commands, it lists out the files from tar command as expected, but it doesn't actually copy up the data, though I get no errors or anything. Have no clue what is wrong (other than I am still quite new to docker)

EDIT: I got it working. For whatever reason, I had to add a dot (.) at the end of the backup command to backup everything as it should have. Maybe it was a fluke, but when I restored from that file, it finally worked.

Ответить
МЫКЫТО КОЖЕМЯКА
МЫКЫТО КОЖЕМЯКА - 04.09.2023 18:24

how i could make backup and restore when in 1 container i have many volumes. for example container with zabbix which consist from mysql\ssl\snmptraps\keys volumes???

Ответить
BC.export БИЗНЕС С КИТАЕМ
BC.export БИЗНЕС С КИТАЕМ - 17.08.2023 17:19

Clear and understandable. U r genius

Ответить
Dami Ortiz
Dami Ortiz - 21.06.2023 18:36

no encuentro el Cheat-Sheets del que hablas

Ответить
jim mertzos
jim mertzos - 09.06.2023 23:12

Github Link doesnt work, the page you showcase is nowhere to be found !!

Ответить
Francois van der Merwe
Francois van der Merwe - 06.06.2023 10:35

Hi Christian, thanks so much for this video, super helpful. I am however not seeing the devops folder in order to test the backup and restore commands you use. Could you please advise?

Ответить
tromtrom
tromtrom - 22.05.2023 09:31

Hi, wenn ich das auf meinem raspberry pi ähnlich mache wie du beschreibst (aber ohne busybox) und am Ende auf dem neuen Raspberry Pi "sudo docker load -i image.tar " eingebe, erscheint immer: no such file or directory
an was kann das liegen?
Ich starte meinen alten pi von SD karte. an USB hängt die neue M.2 SSD, auf welcher der neue pi schon funktionsfähig installiert wurde und welche einfach als usb-stick gemountet ist. dort kopiere ich die tar-datei hin.
Dann starte ich von dieser SSD und will die tar mit dem genannten befehl wieder verfügbar machen..... :(

Ответить
Eduardo Rodriguez
Eduardo Rodriguez - 19.05.2023 10:36

I'm currently hosting a nextcloud container on a Raspberrypi and want to move it to a desktop computer that will function as my new server (both running Ubuntu). Is this the prefer method to move my data from one machine to another? Would you suggest just backing up the data and create a new container 'From the scratch'? I don't have any 'special' apps on Next cloud. I am using it exclusively as cloud storage

Ответить
Hatt
Hatt - 01.05.2023 16:44

Good day Mr. Lempa, I hope you are doing well! I have a question for you. Suppose I had a Docker Swarm that, at the moment, consists of 4 raspberry pi 4s each with a 500gb m.2 SSD drive plugged into them. Suppose further that I am also running Portainer to manage my containers. Now suppose that what I want to achieve is data persistence across these 4 Nodes so that if, say, the node containing the data for my Gitea instance goes down and maybe even stays down, another node should start up the service and also still have the necessary data. Any idea on how I could achieve this?

You see what I mean?

Ответить
GI D
GI D - 21.04.2023 22:23

How reliable is the backup if the container is running and accessing it while you make the tar? Hmmm....

Ответить
joel fankam
joel fankam - 30.03.2023 09:51

thanx , youe ease my job

Ответить
blackburn116
blackburn116 - 16.03.2023 19:19

For Windows users without WSL2 replace $(pwd) with %cd% in the backup a container command:
docker run --rm --volumes-from CONTAINER -v %cd%:/backup busybox tar cvfz /backup/backup.tar CONTAINERPATH

Ответить
Kitty
Kitty - 21.02.2023 18:50

Sir, half of you video got deleted in editing.

Ответить
Kalaiyarasan Sivaji
Kalaiyarasan Sivaji - 19.02.2023 19:15

How can we run that migrate command for the container which is having more than one container path?

Ответить
Gavin
Gavin - 18.01.2023 11:06

Dust against the mailer in in time setting

Ответить
ajunior7
ajunior7 - 29.12.2022 06:46

(assuming everything is binded) Alternatively, can I just copy the directory where I made folders for my containers in a tarball and export my container config as stacks, then in my fresh install - copy over your existing directories to where they once were and re-deploy the containers with stacks (.yaml files) that I exported?

Ответить
Seff2
Seff2 - 28.11.2022 15:17

you really should have taken the 3 minutes to also explain how to restore an image with the backed-up file. Becuase the command in your cheat sheat is really confusing, and its unclear if i have to create the image first, or what container names I should use in the command....

Ответить
theitzone01
theitzone01 - 22.10.2022 21:14

My Raspberry Pi Lite OS runs on a 64GB Micro SD card boot drive and I have a secondary 2TB SSD to store data in. I plan to install Jellyfin and PhotoPrism and NextCloud which requires installing Maria MySQL Data Base. What has me confused is how I specify all docker data storage for PhotoPrism, JellyFin and Nextcloud to take place on the 2TB SSD drive and not the 64GB Micro SD card boot drive? Do you have a video that shows correct docker Volume syntax that enables data to get stored onto a 2TB SSD secondary data drive?

Ответить
ΙΟΡΔΑΝΗΣ ΠΕΛΕΖΙΚΗΣ
ΙΟΡΔΑΝΗΣ ΠΕΛΕΖΙΚΗΣ - 21.09.2022 14:14

Can't see cheat sheet of the video at the description link.

Ответить
hamhumtube
hamhumtube - 13.08.2022 08:25

what if container has more CONTAINERPATH?

Ответить
ARKANJO
ARKANJO - 29.07.2022 19:34

thank you so much

Ответить
Sugizo Akino
Sugizo Akino - 19.06.2022 15:43

Is there any way I can do this on Heroku? It accepts commands by Shell. I'm using a bot, but the docker image was archived by the admin. Can you help me? I don't understand any of this. I just wanted to backup this docker and upload on dockerhub to help others who don't have a bot working before adm archived everything. Could you help me, please?

Ответить
Salim Dawod
Salim Dawod - 18.06.2022 17:08

Thx bro for the great explanation, But i have a point in restore section which I've got while doing it on Mysql docker volume,
unfortunately the restore command here won't work when use it on mysql container so I had to create a new volume and extract the backup file into it before running the new container.

Ответить
Marcel K.
Marcel K. - 20.04.2022 21:39

Bester Mann 😀
Danke für all deine hilfreichen und interessanten Videos!

Ответить
Moroccan
Moroccan - 20.04.2022 17:06

I can't find your devops cheat-sheets. Its just me?

Ответить
Thomas Tomchak
Thomas Tomchak - 07.03.2022 01:04

Thank you for doing this tutorial. The more I learn about docker the more excited I get about what it can do.

I was able to get your backup command to work perfectly and to scp that file over to the new host. However, I can not get the restore to work at all. In this video you stopped short of demonstrating the restore, I assume because it was obvious to most. However I'm falling short of knowing what's going wrong. I keep getting PATH errors related to "bash" executable, and I'm not even sure how to track that down since I don't understand what it's trying to tell me.

I would be most grateful if you covered restoring using your one-line command in a future video.

Thank you for the content that you put out. It's most appreciated.

Ответить
Manfred Rotgers
Manfred Rotgers - 10.02.2022 19:05

Hi, great video thnx
I have a nginx container on a pi that I want to move to docker on proxmox, but this container has multiple paths. do I need to run the backup command multiple times?

Host/volume Path in container
/home/pi/nginx/data /data
/home/pi/nginx/letsencrypt /etc/letsencrypt
/home/pi/nginx/config.json /app/config/production.json

Ответить
giftcp
giftcp - 29.01.2022 23:24

HI. I am getting the error "docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "bash": executable file not found in $PATH: unknown." when I try to restore. Please point me in the right direction

Ответить
shashank marri
shashank marri - 23.01.2022 00:23

Hi, when I try to generate the tar file, I get this error

can't open '/backup/backup.tar': No such file or directory

could you please help.

Ответить
Fauzi Fauzi
Fauzi Fauzi - 20.01.2022 06:08

Hi there, I tried restoring compressed backup with your cheat sheet, but it doesn't work with busybox image. Then I tried using ubuntu image and it works.

Ответить
Arwen Drew
Arwen Drew - 19.01.2022 18:21

What about if you have a couple containers being ran by docker-compose?

Ответить
CaMiX
CaMiX - 13.01.2022 23:05

Looks like you need to update your cheat sheet repo's readme cause a lot of the links are broken.

Ответить
ChlorineAddict
ChlorineAddict - 21.12.2021 20:14

One thing I don’t understand about Volumes is they seem built for hello-world sized projects on a single drive systems. Volumes seem neat, but a restricted alias of Binds which doesn’t allow you to specify which drive you want data stored. Most my docker use cases require data storage that exceeds my OS drive size, but that’s where volumes stores data because it’s built into docker, not on my Data drive. Is there something I’m missing about Volumes that would make them useful for larger storage needs?

Ответить
hoho Jimmy
hoho Jimmy - 18.12.2021 13:34

It’s very simple,police finding me now

Ответить
Sebastian Abendschön
Sebastian Abendschön - 20.11.2021 00:57

One of the best videos ever! Very useful!

Ответить
Simon Romanski
Simon Romanski - 26.10.2021 18:07

You can't beat the amount of useful content that is packed into each episode.

Ответить
Alfredo Alarcón Yáñez
Alfredo Alarcón Yáñez - 26.10.2021 13:37

Thank you very much for all your videos, they are awesome

Ответить
Mike Heck
Mike Heck - 27.09.2021 21:21

Perfect Video. Thank You. I hope is corect wrided. My english is Not god. But i understand you.

Ответить
Living the Mad Scientist Life
Living the Mad Scientist Life - 27.09.2021 21:12

Outstanding mate, from a Computer Scientist and a Professor, you have a great talent and a great team.
All my best.

Ответить
Harmacist
Harmacist - 15.09.2021 16:10

I'm new to docker, but could you not mount the volume inside a path instead of a named path and just use normal methods to back it up?

Edit: Found your content the other day and want to give you props for your information and delivery.

Ответить
Phùng Hạnh
Phùng Hạnh - 15.09.2021 03:40

This is really good, thank you :).
Is there a way to migrate or clone an app running with docker-compose, which has both named and bind volumes?

Ответить
tariq
tariq - 15.09.2021 01:11

can you make tutorial on how to run multiple services in same docker container ?

Ответить
Ronald
Ronald - 14.09.2021 20:28

You are my favorite bald online friend

Ответить
Clarence
Clarence - 14.09.2021 20:01

offen/docker-volume-backup is an absolute blessing to easily automate docker volume backups.

Ответить
Mukhammadamin Abdullaev
Mukhammadamin Abdullaev - 14.09.2021 19:56

Content that you created is much clear and useful ) . Keep making more content. We will be wait content about `Kubernetes` for upcoming sessions.

Ответить
Friso Dubach
Friso Dubach - 14.09.2021 18:50

Why not just use something like Duplicati for this?

Ответить