# Database migrations / Dgraph update

**URL:** <https://discuss.dgraph.io/t/database-migrations-dgraph-update/13984>\
**Category:** GraphQL\
**Tags:** kind:question\
**Created:** [May 3, 2021, 1:51pm UTC](https://discuss.dgraph.io/t/database-migrations-dgraph-update/13984 "2021-05-03T13:51:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maaft](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@maaft](https://discuss.dgraph.io/u/maaft)\
**Post date:** [May 3, 2021, 1:51pm UTC](https://discuss.dgraph.io/t/database-migrations-dgraph-update/13984/1 "2021-05-03T13:51:01Z")

</div>

In the past, sometimes we had issues with an existing database after we upgraded dgraph versions. Which is okay, as our project is not in production yet. But in production, obviously there can’t be any issues when upgrading dgraph versions.

What do we need to do to **make sure** that no data is lost between upgrades? Are there some scripts that we need to run manually before an update?

---

<div class="post-metadata">

**Author:** ![chewxy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/chewxy/32/4339_2.png) [@chewxy](https://discuss.dgraph.io/u/chewxy)\
**Post date:** [May 3, 2021, 10:02pm UTC](https://discuss.dgraph.io/t/database-migrations-dgraph-update/13984/2 "2021-05-03T22:02:17Z")

</div>

See also two separate and related feature requests:

> [@Feature request: Zero-downtime upgrades](http://discuss.hypermode.com/t/feature-request-zero-downtime-upgrades/13937):
>
> Currently, when upgrading from one Dgraph version to the next, there is no way to do this without some downtime in the cluster. For high availability, it would be awesome to be able to upgrade a Dgraph cluster with zero downtime. This was discussed [here](http://discuss.hypermode.com/t/mixing-dgraph-versions-in-a-cluster-while-upgrading/13899), and as per @chewxy’s request, I have created a separate thread for this. One possible approach was suggested by @MichelDiz : Ideally, the zero downtime would be for both reads and writes. I’m aware that currently tablets are blocked for wr…

> [@Improve Dgraph upgrade experience by supporting in-place & rolling upgrades](http://discuss.hypermode.com/t/improve-dgraph-upgrade-experience-by-supporting-in-place-rolling-upgrades/8821):
>
> Moved from GitHub [dgraph/4644](https://github.com/dgraph-io/dgraph/issues/4644) Posted by [sleto-it](https://github.com/sleto-it): Experience Report This is a feature request to add an additional upgrade method, the in-place upgrade, which can coexist with our current logical upgrade method When the in-place upgrade will be available, this is a FR to support rolling upgrades (one node at a time) of Dgraph clusters, so that the upgrade can be done while the cluster remains up and running, and ideally while it keeps serving reads and/or reads and writes What you wanted to …
