patternsqlMinor
Import and Export database in Mongo just like MySQL
Viewed 0 times
justmongolikedatabasemysqlexportandimport
Problem
I am newbie to the
Mongo.Before this I have worked only with MySQL.In MySQL we can import and export database easily.I want to know is there any option available in Mongo to import and export database easily.Any help and suggestions will be highly appreciable.Solution
If you look inside mongodb/bin folder (
You can find a couple of binaries.
The mongoDB has import and export tools.
If you're running mongod locally on the default port, you can just do:
Example: Dumping Everything
Example: Dumping a Single Collection
Others like
mongoexport, mongoimport, mongorestore, bsondump etc.
for more http://www.mongodb.org/display/DOCS/Import+Export+Tools
ls -l)You can find a couple of binaries.
The mongoDB has import and export tools.
If you're running mongod locally on the default port, you can just do:
$ ./mongodumpExample: Dumping Everything
$ ./mongodump --host prod.example.comExample: Dumping a Single Collection
$ ./mongodump --db blog --collection postsOthers like
mongoexport, mongoimport, mongorestore, bsondump etc.
for more http://www.mongodb.org/display/DOCS/Import+Export+Tools
Code Snippets
$ ./mongodump$ ./mongodump --host prod.example.com$ ./mongodump --db blog --collection postsContext
StackExchange Database Administrators Q#15625, answer score: 3
Revisions (0)
No revisions yet.