Forrest logo
tool overview
On this page you find all important commands for the CLI tool mongorestore. If the command you are looking for is missing please ask our AI.

mongorestore

Mongorestore is a command line tool provided by MongoDB, which allows users to restore MongoDB backups from the command line interface. It is used to import data from BSON or JSON files created by mongodump, which is MongoDB's backup tool. Mongorestore is often utilized to quickly restore large amounts of data or databases into MongoDB instances. The tool supports various compression formats like gzip or zip, which allows users to restore compressed backup files directly. It provides options to specify the host and port of the MongoDB server where the data needs to be restored. Mongorestore also offers authentication options, enabling users to provide credentials to connect to a MongoDB server that requires authentication. Additionally, users can specify the target database and collection where the data should be restored within the MongoDB server. By default, mongorestore creates a new database with the same name as the source database and restores the data into that. The tool can be used in conjunction with other MongoDB utilities to automate backup and restore processes or to migrate data between MongoDB clusters. Overall, mongorestore is a powerful command line tool that simplifies the process of restoring backups or migrating data in MongoDB environments.

List of commands for mongorestore:

  • mongorestore:tldr:7689d mongorestore: Import a BSON data dump from a directory 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-directory} --password
    try on your machine
    explain this command
  • mongorestore:tldr:8c540 mongorestore: Import a BSON data dump from a directory to a MongoDB database.
    $ mongorestore --db ${database_name} ${path-to-directory}
    try on your machine
    explain this command
tool overview