# How to import exported (json format) database with the mutation

**URL:** <https://discuss.dgraph.io/t/how-to-import-exported-json-format-database-with-the-mutation/10516>\
**Category:** Dgraph\
**Tags:** kind:question, dgraph, area:graphql, area:import-export\
**Created:** [September 22, 2020, 11:11am UTC](https://discuss.dgraph.io/t/how-to-import-exported-json-format-database-with-the-mutation/10516 "2020-09-22T11:11:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![meshsoni](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@meshsoni](https://discuss.dgraph.io/u/meshsoni)\
**Post date:** [September 22, 2020, 11:11am UTC](https://discuss.dgraph.io/t/how-to-import-exported-json-format-database-with-the-mutation/10516/1 "2020-09-22T11:11:36Z")

</div>

I used an admin mutation to export database into the json format,  
After export it give me the three json files.

Now I don’t know which file is need to be imported and how to import that file using the mutation script.

---

<div class="post-metadata">

**Author:** ![anand](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/anand/32/5674_2.png) [@anand](https://discuss.dgraph.io/u/anand)\
**Post date:** [September 22, 2020, 11:54am UTC](https://discuss.dgraph.io/t/how-to-import-exported-json-format-database-with-the-mutation/10516/2 "2020-09-22T11:54:22Z")

</div>

Welcome Mahesh.  
I am assuming you fired the mutation as described at this [link](https://dgraph.io/docs/deploy/dgraph-administration/#exporting-database).

The export folder will typically contain the following:  
(a) g01.json.gz: This is actual data, which you will use for imports later.  
(b) g01.gql\_schema.gz: This is the graphql schema. You can extract the contents and initialize a new dgraph instance using this schema.  
© g01.schema.gz: This is a Dgraph format. You can choose to ignore it.

In a new Dgraph graphql instance:

1. Initialize the graphql schema by a curl command using contents of the schema file (b)  
`curl -X POST localhost:8080/admin/schema --data-binary '@g01.gql_schema'`
2. Fire the live loader as below. You can directly use the data file (a)

```auto
./dgraph live -f ./export/dgraph.r25.u0922.1137/g01.json.gz

```

Pass the data file with the -f argument. That should do it.

---

<div class="post-metadata">

**Author:** ![meshsoni](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@meshsoni](https://discuss.dgraph.io/u/meshsoni)\
**Post date:** [September 22, 2020, 12:38pm UTC](https://discuss.dgraph.io/t/how-to-import-exported-json-format-database-with-the-mutation/10516/3 "2020-09-22T12:38:11Z")

</div>

@anand Thanks for the instant support

Can we any option to import it using the dgraph mutation script?

---

<div class="post-metadata">

**Author:** ![anand](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/anand/32/5674_2.png) [@anand](https://discuss.dgraph.io/u/anand)\
**Post date:** [September 22, 2020, 12:39pm UTC](https://discuss.dgraph.io/t/how-to-import-exported-json-format-database-with-the-mutation/10516/4 "2020-09-22T12:39:45Z")

</div>

No, the exported data can only be imported via bulk or live loaders.

---

<div class="post-metadata">

**Author:** ![meshsoni](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@meshsoni](https://discuss.dgraph.io/u/meshsoni)\
**Post date:** [September 22, 2020, 12:40pm UTC](https://discuss.dgraph.io/t/how-to-import-exported-json-format-database-with-the-mutation/10516/5 "2020-09-22T12:40:49Z")

</div>

@anand Thank you very must for giving me the right direction.

---

<div class="post-metadata">

**Author:** ![vs369](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/vs369/32/9617_2.png) [@vs369](https://discuss.dgraph.io/u/vs369)\
**Post date:** [March 3, 2022, 4:29am UTC](https://discuss.dgraph.io/t/how-to-import-exported-json-format-database-with-the-mutation/10516/6 "2022-03-03T04:29:27Z")

</div>

i have some files which exported g01.gql\_schema.gz , g01.json.gz , g01.schema.gz i need to import those files to dgraph

i tried all steps , please help me

 ![Screenshot from 2022-03-03 09-56-40](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/5/55312da889c3cce12b10b8b674e9e179710db0b4.png)
