I have create backups with mongodump utility. Having 2 servers in replica set configuration.
Mongo backups are in directory /var/backups/18May2021 . And I want to restore it on another server which is standalone . mongo server with backup configuration ip is for example 22.214.171.124 and the server which is standalone and wanting to restore backup here is 126.96.36.199. How can I do it, inside the backup folder /var/backups/18May2021 there are two folders admin and products.
If you are taking a backup with mongodump then you will use the mongorestore tool to restore the data. You just add the standalone host as the “host” in the restore string. It would look something like this
mongorestore --host 188.8.131.52 --port <port number> -u <admin user> --authenticationDatabase <auth db> /var/backups/18May2021
The admin and products directory are the databases in your MongoDB so they will both be restored.
Thank u ,
so in case of not using auth it will be:
mongorestore --host 184.108.40.206 --port 27017 /var/backups/18May2021.
Yes, if there is no authentication on your Mongo cluster you would not provide a username or authentication DB
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.