# About migration

**URL:** <https://discuss.dgraph.io/t/about-migration/16460>\
**Category:** Dgraph\
**Created:** [January 5, 2022, 9:20am UTC](https://discuss.dgraph.io/t/about-migration/16460 "2022-01-05T09:20:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![littleone](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/littleone/32/6333_2.png) [@littleone](https://discuss.dgraph.io/u/littleone)\
**Post date:** [January 5, 2022, 9:20am UTC](https://discuss.dgraph.io/t/about-migration/16460/1 "2022-01-05T09:20:54Z")

</div>

dgraph use uid to store the relations between nodes, when migrate to another database, all the uids will re-generate, so all the relations will disappear? in that way, for migration, I should use x-id as id?

---

<div class="post-metadata">

**Author:** ![amaster507](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/amaster507/32/4123_2.png) [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Post date:** [January 5, 2022, 1:51pm UTC](https://discuss.dgraph.io/t/about-migration/16460/2 "2022-01-05T13:51:20Z")

</div>

Doesn’t export/import or backup/restore account for this. These are the proper ways to migrate data. What is your migration process?

I’m assuming “to another database” you mean another Dgraph instance, right?

---

<div class="post-metadata">

**Author:** ![littleone](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/littleone/32/6333_2.png) [@littleone](https://discuss.dgraph.io/u/littleone)\
**Post date:** [January 7, 2022, 10:21am UTC](https://discuss.dgraph.io/t/about-migration/16460/3 "2022-01-07T10:21:55Z")

</div>

yes, all of them are dgraph.

the situation is, by now, I just use the instance in my own machine. I wonder if I migrate it to the cloud in the future, all the relations will keep the same, or what should I do for this situation.

---

<div class="post-metadata">

**Author:** ![amaster507](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/amaster507/32/4123_2.png) [@amaster507](https://discuss.dgraph.io/u/amaster507)\
**Post date:** [January 7, 2022, 1:32pm UTC](https://discuss.dgraph.io/t/about-migration/16460/4 "2022-01-07T13:32:58Z")

</div>

If you do a full backup of local and restore to the cloud then you should have the same uids.

I know when they launched the namespaces in the cloud I had this same concern and I copied all uids for existing nodes to an xid field but when the support migrated my instance they were able to keep all my same uids in tact.
