I created a backup of all my databases using mongodump command. Now I want to restore a specific database using mongorestore command.
How is this possible, I use this command: –db option then mongodb doesn't restore a specific database.
mongodb
I created a backup of all my databases using mongodump command. Now I want to restore a specific database using mongorestore command.
How is this possible, I use this command: –db option then mongodb doesn't restore a specific database.
Best Answer
To restore a single database you need to provide the path to the dump directory as part of the
mongorestore
command line.For example:
The
--db
option formongodump
specifies the source database to dump.The
--db
option formongorestore
specifies the target database to restore into.