Synology docker suite migration

One day, I suddenly received a message that the storage space 1 of Synology had a disk failure. But after trying the functions, the functions are still normal, so I dragged on for a few days before starting the migration to avoid further hard disk failure.

 

The hard disk of storage space 1 stores all the installed packages, including the docker suite and the container of the docker suite. The main reason is that the migration of this part is troublesome. Just copy and paste other files such as pictures to other spaces.

General packages can be migrated through a third-party package of Package Manager, specifically Baidu. But something like docker is not very applicable. So the following is to record the migration process for reference by friends who have the same situation, and also as a memo to prevent the same situation from happening again next time.

My docker installation has nginx, qb, and jellyfin, and it is the same as the original use after migration. After reading online articles, some containers may be special, so they may not be 100% universal.

Goal: Migrate the docker suite from storage space 1 to storage space 3 without loss.

1. Export and stop the container

Export the content and settings of the containers that need to be migrated one by one, and stop the containers after exporting. The export generates a corresponding .txz file

 

2. Disable or uninstall the docker suite

Find docker in the package center and disable it.

3. Modify the location of the docker shared folder

It turns out that the files related to the docker container are placed in the docker shared directory under storage space 1, and the directory stores the configuration related to the container, such as: nginx conf file, qb configuration file, etc. As shown in the figure below, it has been migrated to storage space 3, so it is displayed as 3:

 

The key to lossless migration should be in this part, modify the shared folder from storage space 1 to storage space 3, as shown in the figure:

 4. Reinstall the docker suite to the new storage space

In the second step, if it has not been uninstalled, you can uninstall the docker suite in this step, and then reinstall docker, and select the installation location as storage space 3.

5. Import container

After docker is reinstalled, the container list should be empty. At this time, import the .txz file exported in the first step, so that the entire migration is completed. When the container is started, all services are still exactly the same, and the data settings have not changed.

Summarize:

The key step is the third part of migrating the shared folder, because I put it in a separate shared folder for the overall migration, so the container does not need to be modified after migration. If the situation is different, you should infer other cases from one instance. Matching the container-related file path mapping with the migrated container configuration file path should also have the same effect.

Guess you like

Origin blog.csdn.net/z409595641/article/details/130581141