Export MySQL to MongoDB

I want to export an existing MySQL database table to seed the MongoDB database.

I would think that this is a well-beaten path, but it seems that this is not so, since I am just confused with a simple MySQLDUMP -> MongoDB JSON converter.

It does not take much effort to code such a conversion utility.

+19
mysql mongodb
Jul 05 '10 at 15:38
source share
7 answers

If you use Ruby, you can also try: Mongify

It will read your mysql database, build a translation file and let you display the information.

It supports:

  • Updating Internal Identifiers (for BSON Object Identifier)
  • Update Reference Identifiers
  • Type of casting value
  • Insert tables into other documents
  • Before filters (for manually changing data)
  • and much more...

Read more about this at: http://mongify.com/getting_started.html

+5
Jul 26 '12 at 20:50
source share

MongoVue is a new project that contains the import of MySQL: MongoVue . I have not used this feature.

+4
Aug 23 '10 at 15:47
source share

If you are a Mac user, you can use MongoHub , which has a built-in function to import (and export) data from MySql databases.

+3
May 30 '14 at 13:09
source share

If you use java, you can try this

http://code.google.com/p/sql-to-nosql-importer/

+2
Jul 23 '11 at 6:07
source share

There is a method that does not require the use of any other software than the mysql and mongodb utilities. The disadvantage is that you need to go at the table at the table, but in your case you only need to move one table, so it will not be painful.

I followed this tutorial . Relevant Parts:

  • Get a CSV with your data. You can create one of the following queries in mysql.

    SELECT [fields] INTO outfile 'user.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' FROM [table] 
  • Finally, import the file using mongoimport . What all
+2
Jul 06 '16 at 10:43
source share

For a powerful conversion utility check out Tungsten Replicator

I'm still considering int this, called SQLToNoSQLImporter , which is written in Java.

+1
Mar 11 '15 at 8:48
source share

I have something on GitHub - it’s not even 80%, but it is growing for work, and maybe something else of you can help me!

https://github.com/jaredwa/mysqltomongo

0
Mar 27 '13 at 1:52
source share



All Articles