# Data volumes - surviving engine upgrades

**URL:** <https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172>\
**Category:** Docker Desktop\
**Tags:** windows\
**Created:** [January 10, 2018, 12:30pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172 "2018-01-10T12:30:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![asifarran](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@asifarran](https://forums.docker.com/u/asifarran)\
**Post date:** [January 10, 2018, 12:30pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/1 "2018-01-10T12:30:23Z")

</div>

I am new to Docker and have just got a taste of how volatile things are when I had to downgrade _Docker for Windows_ to a previous version to get port forwarding to localhost working again (as per [this issue](https://github.com/docker/for-win/issues/1506)).

I intend to run postgresql in a container and use an data volume to persist the db’s data independently from the container.

Having had to update (in this case backwards) the engine I notices the Moby VM gets destroyed and re-created which effectively means everything in it (including the data volumes) evaporates.

That seems impossibly scary!

Am I missing something here? How does one set up a persistent data volume that lives across Docker engine updates?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![sdetweil](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sdetweil](https://forums.docker.com/u/sdetweil)\
**Post date:** [January 10, 2018, 1:02pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/2 "2018-01-10T13:02:00Z")

</div>

the persistent data volume must be on the host media, and mounted into the containers for use.  
that way, when the containers stop, the data doesn’t go away

---

<div class="post-metadata">

**Author:** ![asifarran](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@asifarran](https://forums.docker.com/u/asifarran)\
**Post date:** [January 10, 2018, 1:11pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/3 "2018-01-10T13:11:53Z")

</div>

Please note that I am not asking about how to persist data when containers stop/start but how to do so without worrying about updates to **Docker for Windows itself** causes the volumes to be deleted (as part of re-creating the MobyLinux VM)

---

<div class="post-metadata">

**Author:** ![sdetweil](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sdetweil](https://forums.docker.com/u/sdetweil)\
**Post date:** [January 10, 2018, 1:37pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/4 "2018-01-10T13:37:01Z")

</div>

sorry, i don’t understand the distinction…

if the containers might stop for any reason, then the persistent data volumes **CANNOT** be inside containers.

---

<div class="post-metadata">

**Author:** ![asifarran](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@asifarran](https://forums.docker.com/u/asifarran)\
**Post date:** [January 10, 2018, 1:48pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/5 "2018-01-10T13:48:31Z")

</div>

Yes, they live inside the VHDX disk that contains the MobyLinuxVM which is created by _Docker for Windows_ as part of the installation process.

So, you can start, stop and re-create containers at will and your data volumes are safe.

BUT, if you now want to upgrade _Docker for Windows_ itself to a new version, that VHDX gets thrown away and replaced by a new one and with it goes all your data.

---

<div class="post-metadata">

**Author:** ![sdetweil](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sdetweil](https://forums.docker.com/u/sdetweil)\
**Post date:** [January 10, 2018, 1:50pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/6 "2018-01-10T13:50:35Z")

</div>

put the data volumes on C: (or some other WINDOWS HOST volume) not IN the VHDX

---

<div class="post-metadata">

**Author:** ![asifarran](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@asifarran](https://forums.docker.com/u/asifarran)\
**Post date:** [January 10, 2018, 1:53pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/7 "2018-01-10T13:53:46Z")

</div>

I wish, but for some scenarios (I for example want to run postgresql in a container) you can’t use an NTFS volume.

---

<div class="post-metadata">

**Author:** ![sdetweil](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sdetweil](https://forums.docker.com/u/sdetweil)\
**Post date:** [January 10, 2018, 1:56pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/8 "2018-01-10T13:56:07Z")

</div>

well, **THAT** is a different problem… I can’t see how it would know… if you use -v or --mount,type=bind

i see the bug… and the workaround, ‘backup regularly’!..

---

<div class="post-metadata">

**Author:** ![asifarran](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@asifarran](https://forums.docker.com/u/asifarran)\
**Post date:** [January 10, 2018, 2:03pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/9 "2018-01-10T14:03:25Z")

</div>

It wouldn’t care when you install but would fail when syncing to disk at runtime. It expects ext.

I realize that the context for my question is outside the scope of this topic but still maybe someone can point to an alternative solution. for example, is it possible to setup and connect a second virtual disk (i.e other than the MobyLinuxVM one) and mount volumes to containers from it ?

---

<div class="post-metadata">

**Author:** ![sdetweil](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@sdetweil](https://forums.docker.com/u/sdetweil)\
**Post date:** [January 10, 2018, 2:06pm UTC](https://forums.docker.com/t/data-volumes-surviving-engine-upgrades/44172/10 "2018-01-10T14:06:50Z")

</div>

you would have to create some virtual windows disk, and THAT seems to be a problem.

NFS also reported to fail…

there are VDISK drivers for windows, but those are memory backed.
