# How do I use mongorestore?

**URL:** https://forums.foundationdb.org/t/how-do-i-use-mongorestore/1489
**Category:** Using FoundationDB
**Created:** [June 25, 2019, 3:05am UTC](https://forums.foundationdb.org/t/how-do-i-use-mongorestore/1489 "2019-06-25T03:05:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![NetOperatorWibby](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/netoperatorwibby/32/616_2.png) [@NetOperatorWibby](https://forums.foundationdb.org/u/NetOperatorWibby)
#### Post date: [June 25, 2019, 3:05am UTC](https://forums.foundationdb.org/t/how-do-i-use-mongorestore/1489/1 "2019-06-25T03:05:33Z")

</div>

I made a dump of my existing Mongo databases and now want to import them into Foundation. Running `fdbcli` and then the `mongorestore` command didn’t work.

EDIT: Mongo’s [docs](https://docs.mongodb.com/manual/reference/program/mongorestore) says:

> Run [`mongorestore`](https://docs.mongodb.com/manual/reference/program/mongorestore/#bin.mongorestore) from the system command line, not the [`mongo`](https://docs.mongodb.com/manual/reference/program/mongo/#bin.mongo) shell.

I’ve been trying to restore with `mongorestore ~/Desktop/dump-2019-06-24`.

EDIT 2: I managed to figure out `mongoimport`:

```bash
mongoimport --port PORT --authenticationDatabase "admins" --db myDatabaseName --username myAdminUsername --password "myAdminPassword" --file ~/Desktop/dump-2019-06-24/posts.metadata.json

```

EDIT 3: All I’ve managed to do is re-import what I exported back into Mongo. UGH.

**Has anyone imported data into Foundation before?**

---

<div class="post-metadata">

### Author: ![senthil](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/senthil/32/720_2.png) [@senthil](https://forums.foundationdb.org/u/senthil)
#### Post date: [June 26, 2019, 4:02am UTC](https://forums.foundationdb.org/t/how-do-i-use-mongorestore/1489/2 "2019-06-26T04:02:32Z")

</div>

Hi @NetOperatorWibby Yes, we have imported some sample data from MongoDB to FBD through Document Layer using MongoDB GUI client. Basically, a Json export/import. Have not tried directly skipping the Document Layer yet. For this exercise, I wanted Document Layer to take care Key/Value pairs construction.  
How big is your dump? Importing through MongoDB GUI client or BulkInsert API will be time consuming. So need to process them in batches simultaneously.

---

<div class="post-metadata">

### Author: ![NetOperatorWibby](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/netoperatorwibby/32/616_2.png) [@NetOperatorWibby](https://forums.foundationdb.org/u/NetOperatorWibby)
#### Post date: [June 26, 2019, 4:18am UTC](https://forums.foundationdb.org/t/how-do-i-use-mongorestore/1489/3 "2019-06-26T04:18:43Z")

</div>

My dump is only 1.2MB. I wish there was an FDB GUI client but I suppose I’ll use MongoDB Compass.

I want to get used to doing things the FDB way though.

EDIT: Compass doesn’t like FDB, I get `An error occurred while loading navigation: no such cmd: connectionstatus`. Welp. Robo T fails with `Failed to execute "listdatabases" command`.
