Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 359 Vote(s) - 3.55 Average
  • 1
  • 2
  • 3
  • 4
  • 5
converting database from mysql to mongoDb

#1
is there any easy way to change the database from mysql to mongoDB ?

or better any one suggest me good tutorial do it
Reply

#2
If you are looking for a tool to do it for you, good luck.

My suggestion is to just pick your language of choice, and read from one and write to another.
Reply

#3
If I could quote Matt Briggs (it solved my roblem one time):

> The driver way is by FAR the most straight forward. The import/export tools are fantastic, but only if you are using them as a pair. You are in for a wild ride if your table includes dates and you try to export from the db and import into mongo.
>
> You are lucky too, being in c#. We are using ruby, and have a 32million row table we migrated to mongo. Our ending solution was to craft an insane sql statement in postgres that output json (including some pretty kludgy things to get dates going properly) and piped the output of that query on the command line into mongoimport. It took an incredibly frustrating day to write, and is not the sort of thing that can ever really be changed.
>
> So if you can get away with it, use ado.net with the mongo driver. If not, I wish you well :-)
>
> (note that this is coming from a total mongo fanboi)

MySQL is very similar to other SQL databases, so I send You to the topić:

[To see links please register here]



Reply

#4
I am kind of partial to [TalendOpenStudio][1] for those kind of migration jobs. It is an eclipse based solution to create data migration "scripts" in a visual way. I do not like visual programming, but this is a problem domain I make an exception.

Adrien Mogenet has create a [MongoDBConnection][2] plugin for mongodb.

It is probably overkill for a "simple" migration but ut is a cool tool.

Mind however, that the suggestion of Nix will probably save you time if it is a one-of migration.

[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#5
> is there any easy way to change the database from mysql to mongoDB ?

**Method #1**: export from MySQL in a CSV format and then use the [mongoimport tool][1]. However, this does not always work well in terms of handling dates of binary data.

**Method #2**: script the transfer in your language of choice. Basically you write a program that reads everything from MySQL one element at a time and then inserts it into MongoDB.

Method #2 is better than #1, but it is still not adequate.

MongoDB uses collections instead of tables. MongoDB does not support joins. In every database I've seen, this means that your data structure in MongoDB is different from the structure in MySQL.

Because of this, there is no "universal tool" for porting SQL to MongoDB. Your data will need to be transformed before it reaches MongoDB.

[1]:

[To see links please register here]

Reply

#6
You can use the following project.It requires solr like configuration file to be written.Its very simple and straight forward.

[To see links please register here]

Reply

#7
You can use QCubed ([

[To see links please register here]

][1]) framework for that. The procedure would be something like this:

1. Install QCubed ([

[To see links please register here]

][2])
2. Do the codegen on your database. (

[To see links please register here]

)
3. Take your database offline from the rest of the world so that only one operation runs at a time.
4. Now write a script which will read all rows from all tables of the database and use the getJson on all objects to get the json. You can then use the data to convert to array and push it into the mongoDB!






[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#8
[MongoVUE][1]'s free version can do this automatically for you.

It can connect to both databases and perform the import


[1]:

[To see links please register here]

Reply

#9
Try this:
Automated conversion of MySQL dump to Mongo updates using simple r2n mappings.

[To see links please register here]

Reply

#10
If you're using Ruby, you can also try: **[Mongify][1]**

It's a super simple way to transform your data from a RDBS to MongoDB without losing anything.

Mongify will read your mysql database, build a translation file for you and all you have to do is map how you want your data transformed.

It supports:

* **Auto updating IDs (to BSON ObjectID)**
* **Updating referencing IDs**
* Type Casting values
* Embedding tables into other documents
* Before save filters (to allow changes to the data manually)
* and much much more...

Read more about it at:

[To see links please register here]


There is also a short 5 min video on the homepage that shows you how easy it is.


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through