Home Tutorials Restore MongoDB archive backup command

Restore MongoDB archive backup command

Last updated on Apr 04, 2024

mongorestore

-u <USER> \

-h <HOST>:<PORT> \

--gzip \

--archive=<ARCHIVE PATH GZ> \

--noIndexRestore \

-p<PASSWORD> \

--authenticationDatabase=<DATABASE> \

--drop \

--nsFrom="<DATABASE NAME PREVIOUS>.*" \

--nsTo="<DATABASE NAME TO>.*"

Where

  • is the name of the previous database.

  • is the name of the target database