Viktor
Viktor

Reputation: 353

How to backup docker container with data and move to another server?

I'm definitely new to docker at all, started to use it a while ago and I need to move my stuff from one server to another. I thought that just creating a personal image will solve this issue, but nope :D.

So if I'm right, all data is saved on created volume, right? Like one of the containers is PostgreSQL.

So to move everything i need also backup the volume and export it on a new server?

https://docs.docker.com/storage/volumes/#backup-restore-or-migrate-data-volumes

This is what I found on their docs.

Hope somebody could help me with understanding

Upvotes: 1

Views: 8638

Answers (1)

Antonio Petricca
Antonio Petricca

Reputation: 11050

Docker, for default, stored images, containers, volumes, and other data, into /var/lib/docker, if not customized by the file /etc/docker/daemons.json as explained here.

In order to move all the graph to a new server you should:

  • Stop docker service.
  • Copy data root.
  • Restart docker service.

Regards.

Upvotes: 3

Related Questions