How I Backup My Docker Containers

preview_player
Показать описание
In this video, I show you have I backup my Docker containers and their data so that if my server or container has an issue, I can easily recover.

Links:

Timestamps:
0:00 Intro
1:05 Container Folders and Docker Compose
3:10 Example of Recovering Container
Рекомендации по теме
Комментарии
Автор

Maybe just 2 cents to keep in mind here: 1.) You're using bind mounts to mount your volumes to your fs - if the db goes down there is potential, that the state of the db gets corrupted/unreadable or is not up to date when recovering it on a different fs 2.) You're using the ":latest" tag for your db and app in your docker-compose file. Chances for a version upgrade during desaster recovery on a different machine are high (depending on how long the containers were running/weren't manually updated). This is also crucial for your db as tables, row, adressing etc. are prone to change for major version updates. Don't get me wrong, your approach will work probably 95% of times but there are certain things that need to be considered as well besides backing up the compose file and bind-mount volumes on your fs.

zure
Автор

I did the same thing as you did, but sometimes when I restore it, my permissions get all screwed up with no easy way of fixing them. 😔

MilutinMujovic
Автор

Is it possible to recover the old container which got removed during upgrade ..that upgrade is not successful too

rojayadav
Автор

Thanks, that was helpful.
How can I get this docker-compose file? Can I export it from Portainer?
Cheers.

TradersTradingEdge
Автор

I read any database related backups should be dumped instead of copied to mitigate corruption of data.

hskingr
Автор

what gui are you using for interacting with the raspberry pi??

AchterHetBureau
Автор

Could you please show us how to make the restoration process more explained?

streambarhoum
Автор

How would you go about backing up volumes instead of bind mounts, do you just backup the default /var/lib/docker/volumes location or is there a better way?

dawids
Автор

I'd love it if you could cover backing up DATABASE CONTAINERS. maybe also covering whether it's better to have a database as a volume, or saved to mapped file, and how to backup and restore both.

This for me personally is an issue, cause I screw it up everytime, and I essentially have to rebuild stuff everytime cause I can't get it right.

Assuming you're willing to make that video.

DarrylGibbs
Автор

This was not a backup. You just shut down the container and then basically restarted it. Actual backup would be backing up all the data on your server to a different server/cloud/etc. What you should have done was to pull a true backup, wiped the server and installed the OS from scratch, pull your backup down and then restore the data.

yourpcmd
Автор

Mhmhm that isn't a backup strategy you are only using volumes

nerdate
Автор

thanks but what about db how to with it

ammaralzhrani
Автор

this is poorly done explaining, how do you back up odoo for example with database volumes and that depends on another container to run ?

jimmertzos