From the course: Learning MongoDB

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Backups

Backups

- [Instructor] Backups, backups, backups. Seriously. Back up your databases and also test your restore plans. Of course, like any good database there are a number of ways to accomplish backups with MongoDB. We will talk about two of them. Copying data files and using the mongodump and mongorestore programs. The first method we'll talk about is one of the easiest but also one of the most manual. And it has some drawbacks. Right now I'm in the DB path directory from where I started MongoDB with the dash dash DB path and some directory. So in here you can see all the files from MongoDB. What we're going to need to do is back these up. But before we do that, again, to do things right we need to stop any rights to the disc so we can copy these files. And then immediately turn them back on when we're done. To do that, go ahead and log into MongoDB on the shell. And we'll issue the command DB dot fsync lock. And…

Contents