{"id":3910,"date":"2023-04-03T05:00:46","date_gmt":"2023-04-03T05:00:46","guid":{"rendered":"https:\/\/blog.osmosys.co\/?p=3910"},"modified":"2024-02-09T06:10:11","modified_gmt":"2024-02-09T06:10:11","slug":"backup-and-restore-of-docker-volumes-a-step-by-step-guide","status":"publish","type":"post","link":"https:\/\/osmosys.co\/uk\/backup-and-restore-of-docker-volumes-a-step-by-step-guide\/","title":{"rendered":"Backup and Restore of Docker Volumes: A Step-by-Step Guide"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<p><\/p>\n\n\n\n<p>As more and more developers turn to Docker to streamline their development processes, it becomes increasingly important to understand how to take backup and restore a volume in Docker. In this article, we&#8217;ll explore the pain areas around volume backup and restoration, the reasons for doing it, and provide a comprehensive solution that will help you take backup and restore volumes with ease.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-what\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-what\" target=\"_blank\" rel=\"noopener\"><\/a><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-what\"><strong>What?<\/strong><\/h2>\n\n\n\n<p>Docker has become an essential tool for many developers in recent years, allowing them to create and manage containerized applications with ease. One of the most significant advantages of Docker is its ability to manage data volumes, allowing you to store data that persists beyond the lifetime of a container.<\/p>\n\n\n\n<p>However, even with its many benefits, Docker&#8217;s volume management can sometimes be challenging. In particular, taking backups and restoring volumes can be a complex and error-prone process. In this article, we&#8217;ll explore why you might need to take backups of your volumes and how to do it correctly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-why\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-why\" target=\"_blank\" rel=\"noopener\"><\/a><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-why\"><strong>Why?<\/strong><\/h2>\n\n\n\n<p>There are many compelling reasons to do so. Here are a few reasons why you might need to take backups of your Docker volumes:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-disaster-recovery\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-disaster-recovery\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-disaster-recovery\"><strong>Disaster Recovery<\/strong><\/h3>\n\n\n\n<p>The most obvious reason to take backups of your Docker volumes is to protect against data loss in the event of a disaster. By taking regular backups of your volumes, you can ensure that your critical data is safe and recoverable in case of an emergency.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-testing-and-development\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-testing-and-development\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-testing-and-development\"><strong>Testing and Development<\/strong><\/h3>\n\n\n\n<p>Another reason to take backups of your Docker volumes is for testing and development purposes. By creating backups of your volumes at different stages of the development process, you can easily roll back to a previous state if you encounter problems or need to test new features.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-replication\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-replication\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-replication\"><strong>Replication<\/strong><\/h3>\n\n\n\n<p>Taking backups of your Docker volumes can also be useful for replicating data across multiple environments. By creating backups of your volumes and restoring them in other environments, you can ensure that your data is consistent across all of your development, staging, and production environments.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-how\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-how\" target=\"_blank\" rel=\"noopener\"><\/a><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-how\"><strong>How?<\/strong><\/h2>\n\n\n\n<p>Now that we&#8217;ve explored the pain areas and reasons for taking backups and restoring volumes in Docker, let&#8217;s take a look at how to do it correctly. Here are the steps you should follow to take backups of your volumes:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-step-1-identify-the-volume\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-step-1-identify-the-volume\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-step-1-identify-the-volume\"><strong>Step 1: Identify the Volume<\/strong><\/h3>\n\n\n\n<p>The first step in taking a backup of a volume is to identify the volume that you want to back up. You can do this by running the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker volume ls<\/code><\/pre>\n\n\n\n<p>This will show you a list of all the volumes that are currently available on your Docker host. Note down the name of the volume that you want to back up.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-step-2-create-a-backup\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-step-2-create-a-backup\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-step-2-create-a-backup\"><strong>Step 2: Create a Backup<\/strong><\/h3>\n\n\n\n<p>To create a backup of the volume, you can use the&nbsp;<code>docker run<\/code>&nbsp;command to start a container that mounts the volume you want to back up and a separate container that writes the backup data to a file.<\/p>\n\n\n\n<p>Here&#8217;s an example of how to do this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run --rm \\\n--mount source=&lt;volume-name&gt;,target=&lt;target&gt; \\\n-v $(pwd):\/backup \\\nbusybox \\\ntar -czvf \/backup\/&lt;backup-filename&gt;.tar.gz &lt;target&gt;<\/code><\/pre>\n\n\n\n<p>In this command, replace&nbsp;<code>&lt;volume-name&gt;<\/code>&nbsp;with the name of the volume you want to back up,&nbsp;<code>&lt;target&gt;<\/code>&nbsp;with the mount point inside the docker container, and&nbsp;<code>&lt;backup-filename&gt;<\/code>&nbsp;with a name for the backup file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-step-3-move-the-backup-file-to-an-external-server\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-step-3-move-the-backup-file-to-an-external-server\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-step-3-move-the-backup-file-to-an-external-server\"><strong>Step 3: Move the Backup File to an External Server<\/strong><\/h3>\n\n\n\n<p>After you have created a backup file, it&#8217;s a good idea to move it to an external server or storage device to ensure that it&#8217;s safe and secure. Storing the backup file on a separate server or storage device can help to protect it in the event of a disaster, such as a server failure or a security breach.<\/p>\n\n\n\n<p>To move the backup file to an external server, you can use SCP.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>SCP<\/strong>: Secure Copy (SCP) is a secure file transfer protocol that allows you to transfer files between servers using SSH. To use SCP, you will need to have SSH access to both the source and destination servers. You can use the following command to copy the backup file to the external server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nscp \/path\/to\/backupfile user@external-server:\/path\/to\/destination<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-step-4-restore-the-volume\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-step-4-restore-the-volume\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-step-4-restore-the-volume\"><strong>Step 4: Restore the Volume<\/strong><\/h3>\n\n\n\n<p>If you need to restore the volume from the backup, you can use the&nbsp;<code>docker run<\/code>&nbsp;command to start a container that mounts the backup file and a separate container that writes the backup data to the volume.<\/p>\n\n\n\n<p>Here&#8217;s an example of how to do this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run --rm \\\n--mount source=&lt;volume-name&gt;,target=&lt;target&gt; \\\n-v $(pwd):\/backup \\\nbusybox \\\ntar -xzvf \/backup\/&lt;backup-filename&gt;.tar.gz -C \/<\/code><\/pre>\n\n\n\n<p>In this command, replace&nbsp;<code>&lt;volume-name&gt;<\/code>&nbsp;with the name of the volume you want to back up,&nbsp;<code>&lt;target&gt;<\/code>&nbsp;with the mount point inside the docker container, and&nbsp;<code>&lt;backup-filename&gt;<\/code>&nbsp;with a name for the backup file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-example\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-example\" target=\"_blank\" rel=\"noopener\"><\/a><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-example\"><strong>Example<\/strong><\/h2>\n\n\n\n<p>For the purpose of this blog, we will be setting up a basic Docker environment for MongoDB, along with an Express application to visualize the data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-setup-mongodb-docker\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-setup-mongodb-docker\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-setup-mongodb-docker\"><strong>Setup MongoDB Docker<\/strong><\/h3>\n\n\n\n<p>Create a&nbsp;<code>docker-compose.yml<\/code>&nbsp;file.<\/p>\n\n\n\n<p>You can use the below example to setup MongoDB docker:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Use root\/example as user\/password credentials\nversion: '3.1'\nservices:\n  mongo:\n    image: mongo\n    container_name: mongo\n    restart: always\n    environment:\n      MONGO_INITDB_ROOT_USERNAME: root\n      MONGO_INITDB_ROOT_PASSWORD: example\n    volumes:\n      - mongodb:\/data\/db\n  mongo-express:\n    image: mongo-express\n    container_name: mongo-express\n    restart: always\n    ports:\n      - 8081:8081\n    environment:\n      ME_CONFIG_MONGODB_ADMINUSERNAME: root\n      ME_CONFIG_MONGODB_ADMINPASSWORD: example\n      ME_CONFIG_MONGODB_URL: mongodb:\/\/root:example@mongo:27017\/\nvolumes:\n  mongodb: ~<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>In the above example, I added a named volume&nbsp;<code>mongodb<\/code>. Here we have configured docker to persist its data to a volume.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose up<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>To check the running docker containers you can use the below command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker ps<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>You should see 2 docker containers running i.e.&nbsp;<code>mongo<\/code>&nbsp;and&nbsp;<code>mongo-express<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CONTAINER ID   IMAGE           COMMAND                  CREATED          STATUS          PORTS                                       NAMES\n5f68eaf8184a   mongo-express   \"tini -- \/docker-ent\u2026\"   11 seconds ago   Up 9 seconds    0.0.0.0:8081-&gt;8081\/tcp, :::8081-&gt;8081\/tcp   mongo-express\n6789cf1e7bed   mongo           \"docker-entrypoint.s\u2026\"   11 seconds ago   Up 10 seconds   27017\/tcp                                   mongo<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>You can also view the volume which you created using the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker volume ls<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>For me the output looks like this<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DRIVER    VOLUME NAME\nlocal     82fd19dfc5dc839a51b2afd59614474038cd0ce8b494739d883d9b503cd0c61e\nlocal     32582d9a00557c9229418062e6308515c4c4c7eb0bb14a8c43203cafffb675c5\nlocal     docker-test_mongodb<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>The volume name&nbsp;<code>docker-test_mongodb<\/code>&nbsp;was automatically created when I placed my&nbsp;<code>docker-composer.yml<\/code>&nbsp;file inside the&nbsp;<code>docker-test folder<\/code>. This is the location where all of our MongoDB data will be stored.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-modify-mongodb-data\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-modify-mongodb-data\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-modify-mongodb-data\"><strong>Modify MongoDB Data<\/strong><\/h3>\n\n\n\n<p>To confirm that we have successfully restored the database from the volume, we need to make a minor modification to the database.<\/p>\n\n\n\n<p>Visit&nbsp;<code>0.0.0.0:8081<\/code>&nbsp;where the Mongo Express is running.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"793\" height=\"562\" data-src=\"https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/75d1669d-e2a3-4609-8766-ea9b6581e01f-jpg.webp\" alt=\"\" class=\"wp-image-235100 lazyload\" data-srcset=\"https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/75d1669d-e2a3-4609-8766-ea9b6581e01f-jpg.webp 793w, https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/75d1669d-e2a3-4609-8766-ea9b6581e01f-480x340.webp 480w\" data-sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 793px, 100vw\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 793px; --smush-placeholder-aspect-ratio: 793\/562;\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Create a new database here. I created&nbsp;<code>my-new-db<\/code>&nbsp;as the new database.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"793\" height=\"562\" data-src=\"https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/6a853b9f-3036-400d-85ff-74935e1a253c-jpg.webp\" alt=\"\" class=\"wp-image-235101 lazyload\" data-srcset=\"https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/6a853b9f-3036-400d-85ff-74935e1a253c-jpg.webp 793w, https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/6a853b9f-3036-400d-85ff-74935e1a253c-480x340.webp 480w\" data-sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 793px, 100vw\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 793px; --smush-placeholder-aspect-ratio: 793\/562;\" \/><\/figure>\n\n\n\n<p>So now we need to ensure that this new database that is created is also restored.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-take-backup\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-take-backup\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-take-backup\"><strong>Take Backup<\/strong><\/h3>\n\n\n\n<p>Let&#8217;s take the backup of the volume now.<\/p>\n\n\n\n<p>Please run the following command to take the backup.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> docker run --rm \\\n  --mount source=docker-test_mongodb,target=\/data\/db \\\n  -v $(pwd):\/backup \\\n  busybox \\\n  tar -czvf \/backup\/docker-test_mongodb.tar.gz \/data\/db<\/code><\/pre>\n\n\n\n<p><code>\/data\/db<\/code>&nbsp;here is the path that is mounted inside the docker container for the volume.<\/p>\n\n\n\n<p>You should see a backup file created with&nbsp;<code>docker-test_mongodb.tar.gz<\/code>&nbsp;as the file name.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-reset-docker\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-reset-docker\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-reset-docker\"><strong>Reset Docker<\/strong><\/h3>\n\n\n\n<p>As I will be performing the restore process on the same machine, I should delete both the container and the volume.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker rm -v mongo-express<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>docker rm -v mongo<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>docker volume rm docker-test_mongodb<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-restore-backup\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-restore-backup\" target=\"_blank\" rel=\"noopener\"><\/a><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heading-restore-backup\"><strong>Restore Backup<\/strong><\/h3>\n\n\n\n<p>I will proceed to recreate the containers, and we can confirm that the volume has been deleted by checking the databases on Mongo Express.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"793\" height=\"562\" data-src=\"https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/75d1669d-e2a3-4609-8766-ea9b6581e01f-1-jpg.webp\" alt=\"\" class=\"wp-image-235103 lazyload\" data-srcset=\"https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/75d1669d-e2a3-4609-8766-ea9b6581e01f-1-jpg.webp 793w, https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/75d1669d-e2a3-4609-8766-ea9b6581e01f-1-480x340.webp 480w\" data-sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 793px, 100vw\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 793px; --smush-placeholder-aspect-ratio: 793\/562;\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Now we can run the below command to restore the backup.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker run --rm \\\n--mount source=docker-test_mongodb,target=\/data\/db \\\n-v $(pwd):\/backup \\\nbusybox \\\ntar -xzvf \/backup\/docker-test_mongodb.tar.gz -C \/<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Go to Mongo Express and refresh the page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"793\" height=\"562\" data-src=\"https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/6a853b9f-3036-400d-85ff-74935e1a253c-1-jpg.webp\" alt=\"\" class=\"wp-image-235104 lazyload\" data-srcset=\"https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/6a853b9f-3036-400d-85ff-74935e1a253c-1-jpg.webp 793w, https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2024\/02\/6a853b9f-3036-400d-85ff-74935e1a253c-1-480x340.webp 480w\" data-sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 793px, 100vw\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 793px; --smush-placeholder-aspect-ratio: 793\/562;\" \/><\/figure>\n\n\n\n<p>You will now be able to see that the database which we previously created has been successfully restored.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-conclusion\"><a href=\"https:\/\/headingtag.com\/how-to-take-backup-and-restore-a-volume-in-docker#heading-conclusion\" target=\"_blank\" rel=\"noopener\"><\/a><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Taking backups and restoring volumes in Docker can be a complex and error-prone process. However, with the right approach, it&#8217;s possible to ensure that your critical data is safe and recoverable in the event of a disaster. By following the steps outlined in this article, you can take backups of your volumes with ease and restore them when necessary.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As more and more developers turn to Docker to streamline their development processes, it becomes increasingly important to understand how to take backup and restore a volume in Docker. In this article, we&#8217;ll explore the pain areas around volume backup and restoration, the reasons for doing it, and provide a comprehensive solution that will help [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":235099,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[82,106],"tags":[83,84],"class_list":["post-3910","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-technology","tag-devops","tag-dockers"],"modified_by":null,"jetpack_featured_media_url":"https:\/\/osmosys.co\/uk\/wp-content\/uploads\/sites\/6\/2023\/04\/featured-jpeg.webp","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/posts\/3910","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/comments?post=3910"}],"version-history":[{"count":5,"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/posts\/3910\/revisions"}],"predecessor-version":[{"id":235109,"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/posts\/3910\/revisions\/235109"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/media\/235099"}],"wp:attachment":[{"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/media?parent=3910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/categories?post=3910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osmosys.co\/uk\/wp-json\/wp\/v2\/tags?post=3910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}