Report this

What is the reason for this report?

SCP file transfer with mongo db

Posted on June 5, 2018

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?



This textbox defaults to using Markdown to format your 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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.