Where should I move the mongodb dump in production remote server?
-
I created a mongodb dump of database in my localmachine. It was put in dump folder as "myProject". Within myProject I had two files one ending with .bson and other with metadata.json. I moved the myProject folder to my remote server. I used mongorestore on myProject folder. I have installed mongodb in my remote server. I got error /dbpath (/data/db/) does not exist and I fixed them using first solution given here. 1) Now how will mongodb in remote server know the location of my restored dump? 1a) Should I move the .json and .bson file to a new folder named same as the database name ("myProject" placed inside /data/db/)? 2) If I need to move the restored dump where should I move them? 3) Mine is a spring web app and I am running in tomcat sever. So far in my localmachine, the spring bean had the host value as "localhost". Should it be changed to my remote server Ip address, when I am running the application in remote server or Is it fine if the value is localhost?
-
Answer:
you runned mongorestore on your remote server *before* installing mongodb itself? well. once your mongod is running, on your remote server, simply run mongorestore: mongorestore myProject it will deploy your dump inside your dbpath. no need to move your dump folder anywhere. since your mongodb is running, when you execute the mongorestore command, it will connect to your mongodb server and deploy your dump. if you check your /data/db dir contents, you will find database_name.* files there, where database_name are the name of the dumped dbs. you can also run, inside mongodb consoles, the command show dbs to assert your db is there.
Lucas Vieira at Quora Visit the source
Related Q & A:
- Where can I find the information about my e-mail server?Best solution by Yahoo! Answers
- Where can I buy a new Vizio Remote?Best solution by Yahoo! Answers
- How can I get the remote server's date and time at the client side in my application in c#?Best solution by Stack Overflow
- Where can I find TV remote control codes?Best solution by Yahoo! Answers
- Where should I connect my remote wire?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.