Mongorestore Installation On A Debian, Ubuntu, Alpine, Arch, Kali, Fedora And Raspbian

Mongorestore Installation On A Debian, Ubuntu, Alpine, Arch, Kali, Fedora And Raspbian

mongorestore

Utility to import a collection or database from a binary dump into a MongoDB instance.

Maintainer: Debian MongoDB Maintainers



Section: admin

Install mongorestore

  • Debian apt-get install mongo-tools Click to copy
  • Ubuntu apt-get install mongo-tools Click to copy
  • Alpine OS apk add mongodb-tools Click to copy
  • Arch Linux pacman -S mongodb-tools Click to copy
  • Kali Linux apt-get install mongo-tools Click to copy
  • Fedora dnf install mongo-tools Click to copy
  • Raspbian apt-get install mongo-tools Click to copy

Utility to import a collection or database from a binary dump into a MongoDB instance.

How to use mongorestore?

Below are few example commands for mongorestore that you can use in the terminal.

Import a bson data dump from a folder to a MongoDB database:
mongorestore --db database_name path/to/folderClick to copy
Import a bson data dump from a folder to a given database in a MongoDB server host, running at a given port, with user authentication (user will be prompted for password):
mongorestore --host database_host:port --db database_name --username username path/to/folder --passwordClick to copy
Import a collection from a bson file to a MongoDB database:
mongorestore --db database_name path/to/fileClick to copy
Import a collection from a bson file to a given database in a MongoDB server host, running at a given port, with user authentication (user will be prompted for password):
mongorestore --host database_host:port --db database_name --username username path/to/file --passwordClick to copy
Install the latest version of mongorestore in Debian, Ubuntu, Alpine, Arch, Kali, Fedora and Raspbian from terminal. To install the mongorestore just copy the above command for your OS and run into terminal. After you run the command it will grab the latest version of mongorestore from the respository and install it in your computer/server.