Venkat Ch
Venkat Ch

Reputation: 1268

How to take backup of docker volumes?

I'm using named volumes to persist data on Host machine in the cloud.

I want to take backup of these volumes present in the docker environment so that I can reuse them on critical incidents.

Almost decided to write a python script to compress the specified directory on the host machine and push it to the AWS S3.

But I would like to know if there is any other approaches to this problem?

Upvotes: 6

Views: 8217

Answers (1)

Gruber
Gruber

Reputation: 154

docker-volume-backup may be helpful. It allows you to back up your Docker volumes to an external location or to a S3 storage.

Why use a Docker container to back up a Docker volume instead of writing your own Python script? Ideally you don't want to make backups while the volume is being used, so having a container on your docker-compose able to properly stop your container before taking backups can effectively copy data without affecting the application performance or backup integrity.

There's also this alternative: volume-backup

Upvotes: 6

Related Questions