In order to make a backup of the local MongoDB one can use the mongodump program. This program is a command line tool that allows to dump the complete or partial content of a MongoDB instance to some file.
To create such a dump one simply calls the mongodump binary. It takes a multitude of different parameters, where the most importatnt ones are:
After dumping the database one can then use the created file(s) and copy them into a directory under version control or simply send them to other people. If one receives such a database dump one can use the mongorestore program in order to restore the database.
Again one simply has to call the mongorestore binary with the desired parameters. The most important ones are the same as for the mongodump except that it does not accept a query or out parameter, instead one can specify a --dir PATH paramter to tell the program there to look for the dump files and a --drop parameter that instructs the program to drop the old database.
In order to make a backup of the local MongoDB one can use the mongodump program. This program is a command line tool that allows to dump the complete or partial content of a MongoDB instance to some file.
To create such a dump one simply calls the mongodump binary. It takes a multitude of different parameters, where the most importatnt ones are:
After dumping the database one can then use the created file(s) and copy them into a directory under version control or simply send them to other people. If one receives such a database dump one can use the mongorestore program in order to restore the database.
Again one simply has to call the mongorestore binary with the desired parameters. The most important ones are the same as for the mongodump except that it does not accept a query or out parameter, instead one can specify a --dir PATH paramter to tell the program there to look for the dump files and a --drop parameter that instructs the program to drop the old database.
In order to make a backup of the local MongoDB one can use the mongodump program. This program is a command line tool that allows to dump the complete or partial content of a MongoDB instance to some file.
To create such a dump one simply calls the mongodump binary. It takes a multitude of different parameters, where the most importatnt ones are:
After dumping the database one can then use the created file(s) and copy them into a directory under version control or simply send them to other people. If one receives such a database dump one can use the mongorestore program in order to restore the database.
Again one simply has to call the mongorestore binary with the desired parameters. The most important ones are the same as for the mongodump except that it does not accept a query or out parameter, instead one can specify a --dir PATH paramter to tell the program there to look for the dump files and a --drop parameter that instructs the program to drop the old database.