I think someone has already suggested:
1. stop the mongod
2. backup the data directory
Is it reliable, I mean, ensure 100% success to restore?
And I can’t find which directory stores the data… any command can help me to find it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If
mongodprocess exits cleanly (that is, no crashes orkill -9stuff), then it is safe to copy data files somewhere.If your current installation breaks (for example, data corruption due to unclean shutdown), you can delete its files, copy that backup over and start
mongodagain.Default data directory is
/data/db, but it may be set to another value in your config file. For example, I set it to/var/lib/mongodb.You can also use
mongodumpto do a backup from a live server (this may impact performance). Usemongorestoreto restore backups made bymongodump.