Learn web development, system admin, devops, digital marketing, project management and more

At Some Point, You Will Need to Migrate Docker Volumes When Moving Server

In this tutorial video by The Digital Life, the topic of discussion is about learning how to migrate Docker volumes.  This is particularly important if you have applications hosted on one server and need to migrate your Docker containers over to another.

Migrate Docker Volumes

DevOps admins and Developers working with Docker would be aware, all the changes you make to the file system will be lost if you simply destroy the container and redeploy it. So, something to consider also is the data stored on persistent volumes. This needs to be migrated in many cases.

There are two ways discussed in the video on how to migrate persistent data stored within Docker. This refers to either a named volume or a bind mount.

One method of extracting the data from a binding location is to simply copy the directory location where the binding points to.  Finding this location can be assisted by using the docker inspect command. 

This also applies to named volumes, however, these will be stored away in the Docker file system and requires heightened privileges to access the files directly.  Not only that, the whole process becomes a little messy when you are dealing with a multitude of files.

Using Docker CLI Commands For Extracting Volume Data

The advice given in the video is to use Docker CLI commands to copy the volume data extracted from Docker to a tarball archive.  Some cheat sheets have been supplied so you can experiment yourself.  These are available by following the following link to Github...
https://github.com/xcad2k/cheat-sheets/blob/main/devops/docker.md

By going through the process outlined in the tutorial video on how to migrate docker volumes, you should find the backup and restore procedure greatly streamlined.

 

Video - Migrate Docker Volumes - Backup and Restore

Video
Duration: 8mins 56secs
Category: DevOps

Video Time Markers

Video Time Markers for Migrate Docker Volumes - Backup and Restore

(Click or tap play video first before selecting markers)

    Video Authorship and Publishing Credits

    The author and publisher of this video is The Digital Life. Click through to find out more about them and their great learning material.

    Other Videos

    How to Create a Wordpress Theme from an HTML Template
    How to Create a Wordpress Theme from an HTML Template

    Disclosure: Some of the links on this website are affiliate links of which Website Library receives a small commission from the sale of certain items, however the price remains the same for you. For more information please read the Affiliate Disclosure.