# Persist data in Docker / Move data

**URL:** <https://community.dreamfactory.com/t/persist-data-in-docker-move-data/1891>\
**Category:** GitHub Installers\
**Created:** [December 6, 2015, 6:53pm UTC](https://community.dreamfactory.com/t/persist-data-in-docker-move-data/1891 "2015-12-06T18:53:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiptronic](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/tiptronic/32/1202_2.png) [@tiptronic](https://community.dreamfactory.com/u/tiptronic)\
**Post date:** [December 6, 2015, 6:53pm UTC](https://community.dreamfactory.com/t/persist-data-in-docker-move-data/1891/1 "2015-12-06T18:53:11Z")

</div>

I’m using the official dreamfactory docker image.

- Are there some instructions how to upgrade the image without losing any data?
- Do you plan integrating some ENV variables to persist data outside the image (currently data is saved to /opt/dreamfactory/app)?
- How can I port/recreate my docker-container INCLUDING data on another server?

Or do I need to create my own Dockerfile for these?

thx

andy

---

<div class="post-metadata">

**Author:** ![philicious](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/philicious/32/689_2.png) [@philicious](https://community.dreamfactory.com/u/philicious)\
**Post date:** [June 3, 2016, 5:06pm UTC](https://community.dreamfactory.com/t/persist-data-in-docker-move-data/1891/2 "2016-06-03T17:06:40Z")

</div>

env vars are now supported, see [http://www.devops-blog.net/dreamfactory/using-dreamfactory-2-x-as-rest-api-with-docker](http://www.devops-blog.net/dreamfactory/using-dreamfactory-2-x-as-rest-api-with-docker) aswell as [https://blog.dreamfactory.com/scaling-dreamfactory-with-docker](https://blog.dreamfactory.com/scaling-dreamfactory-with-docker)

---

<div class="post-metadata">

**Author:** ![philicious](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/philicious/32/689_2.png) [@philicious](https://community.dreamfactory.com/u/philicious)\
**Post date:** [June 23, 2016, 1:17pm UTC](https://community.dreamfactory.com/t/persist-data-in-docker-move-data/1891/3 "2016-06-23T13:17:38Z")

</div>

To sum things up about updating:

Simply build a new image from their Dockerfile and make sure its not using the git clone from cache (`docker build --no-cache ..`). Their Dockerfile points to latest version. (Or pull latest from DockerHub)  
Personally, I use a copy of their Dockerfile and added `RUN git checkout tags/2.2.0` after the git clone

If you have local app data or local db, you want to make /opt/dreamfactory/storage/app and storage/databases a VOLUME, so you need a custom Dockerfile or make a new one `FROM` theirs.

Have a look here [http://www.devops-blog.net/dreamfactory/orchestrating-dreamfactory-with-docker-compose-and-a-loadbalancer](http://www.devops-blog.net/dreamfactory/orchestrating-dreamfactory-with-docker-compose-and-a-loadbalancer) which basically also answers portability as thats a requirement for immutable containers
