Question

SCP file transfer with mongo db

I have an app running on localhost:8080 and I have scp transferred my MongoDB dumped database to my ubuntu server and placed the dir in /var/lib/mongodb file.

My questions are:

Do I have to run mongorestore on this dir?

Also, after binding my droplet IP address what is the uri for mongo supposed to be? mongo//:<droplet ip/>:27017?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello, @Pappie

In order to restore the Mongo database you need to use the mongorestore command, that is correct.

The command will essentially look like this:

sudo mongorestore --db newdb /var/lib/mongodb

You can also check this tutorial for more detailed instructions:

https://www.digitalocean.com/community/tutorials/how-to-back-up-restore-and-migrate-a-mongodb-database-on-ubuntu-14-04

Hope this helps,

Regards, Alex