Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
containerscrew committed Oct 20, 2023
1 parent 56ccfd0 commit 4410256
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
- [Delete IP data](#delete-ip-data)
- [API alive?](#api-alive)
- [Visualize](#visualize)
- [Import from local mongodb to mongodb atlas](#import-from-local-mongodb-to-mongodb-atlas)
- [Install mongodb tools](#install-mongodb-tools)
- [Dump local database](#dump-local-database)
- [Import local database](#import-local-database)
- [TO DO](#to-do)
- [Contribution](#contribution)
- [LICENSE](#license)
Expand Down Expand Up @@ -183,6 +187,29 @@ Using [mongodb compass](https://www.mongodb.com/products/tools/compass) you can

![data](assets/mongo_data.png)

# Import from local mongodb to mongodb atlas

## Install mongodb tools

```shell
brew install mongodb/brew/mongodb-database-tools
```

If you are not using OSX, please visit the official documentation to install `mongodump` and `mongorestore`

## Dump local database

```shell
mongodump --uri="mongodb://admin:admin@localhost:27017/?maxPoolSize=20&w=majority"
```

This command will create a new `dump/` directory with the backup

## Import local database

```shell
mongorestore --uri="mongodb+srv://USERNAME:PASSWORD@XXXXX.XXXX.mongodb.net/?retryWrites=true&w=majority" --db="ipfinder" --collection="ips" dump/ipfinder/ips.bson
```

# TO DO

Expand Down

0 comments on commit 4410256

Please sign in to comment.