- 34
- 8
- NAS
- DS923+
- Router
- RT6600ax
- WRX560
- Operating system
- Linux
- Windows
- Mobile operating system
- Android
Hello!
I've been using Container Manager for years and I'm very happy with it. I have several Docker containers running without any problems.
Due to a human error, an update was accidentally performed on two linked Docker containers that shouldn't have been updated. I was able to recover them, but it wasn't quick; it tooks me several hours.
I would like that this post can be a general guide on how to manage Docker backups in Container Manager, as well as disaster recovery.
We all know that Container Manager isn't backed up as an "app" in HyperBackup.
First, I will explain my current setup and we will look at its weaknesses:
1. A HyperBackup task that backs up a shared folder called "docker".
This folder basically contains two subfolders:
exports
volumes
As you can deduce, within volumes there's a folder for the volumes of each Docker container I have.
The export folder is detailed below.
2. Some daily tasks I've defined where I perform similar tasks:
cd /volume1/docker/exports/
docker container stop DOCKER_NAME
cd DOCKER_NAME
rm -Rf .
docker export DOCKER_NAME > DOCKER_NAME.tar
gzip DOCKER_NAME.tar
docker container start DOCKER_NAME
What's the problem with this method of creating backups?
Hyperbackup works perfectly: you can recover any volume from the Docker folder.
The problem lies in how each Docker container is backed up.
With
If you then try to perform a
Therefore, this process is not efficient.
In the event of a disaster, I can restore the affected Docker containers by finding the official Docker image, recreating the configuration, and using the volume from a HyperBackup restore.
So, how could we improve this?
How can we run a script that creates a copy of the filesystem state associated with each Docker container, while also including the configuration?
The desired result is that in case of a disaster, I can:
Thanks in advance
Regards,
JOINSO
I've been using Container Manager for years and I'm very happy with it. I have several Docker containers running without any problems.
Due to a human error, an update was accidentally performed on two linked Docker containers that shouldn't have been updated. I was able to recover them, but it wasn't quick; it tooks me several hours.
I would like that this post can be a general guide on how to manage Docker backups in Container Manager, as well as disaster recovery.
We all know that Container Manager isn't backed up as an "app" in HyperBackup.
First, I will explain my current setup and we will look at its weaknesses:
1. A HyperBackup task that backs up a shared folder called "docker".
This folder basically contains two subfolders:
exports
volumes
As you can deduce, within volumes there's a folder for the volumes of each Docker container I have.
The export folder is detailed below.
2. Some daily tasks I've defined where I perform similar tasks:
cd /volume1/docker/exports/
docker container stop DOCKER_NAME
cd DOCKER_NAME
rm -Rf .
docker export DOCKER_NAME > DOCKER_NAME.tar
gzip DOCKER_NAME.tar
docker container start DOCKER_NAME
What's the problem with this method of creating backups?
Hyperbackup works perfectly: you can recover any volume from the Docker folder.
The problem lies in how each Docker container is backed up.
With
docker export, only the current state of the entire filesystem is saved.If you then try to perform a
docker import, it won't allow you to restart the Docker container you may have lost. Synology just creates an image so it can be restarted, but of course, you have to reconfigure everything and is not easy.Therefore, this process is not efficient.
In the event of a disaster, I can restore the affected Docker containers by finding the official Docker image, recreating the configuration, and using the volume from a HyperBackup restore.
So, how could we improve this?
How can we run a script that creates a copy of the filesystem state associated with each Docker container, while also including the configuration?
The desired result is that in case of a disaster, I can:
- Restore the HyperBackup copy to have the latest volume available.
- Without having the affected Docker container in Container Manager, I can restart it in a matter of minutes using the backup I have.
Thanks in advance
Regards,
JOINSO