简体   繁体   English

如何将mysql备份导入mongodb?

[英]How to import a mysql backup to mongodb?

从mysql导入mongodb,有可能吗?

Yes.You can use my plugin. 是的。你可以使用我的插件。 But for that you have to write data transformation configuration. 但为此你必须编写数据转换配置。

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

Expanding on what Flukey said; 扩展Flukey说的话; you need to write a script which will do this for you; 你需要写一个脚本来为你做这件事; there isn't a direct export -> import as MySQL is a relational database, where as MongoDB is a NoSQL database. 没有直接导出 - >导入,因为MySQL是一个关系数据库,而MongoDB是一个NoSQL数据库。

For further understanding on NoSQL you can read here: NoSQL 有关NoSQL的进一步理解,请阅读: NoSQL

You can do something like export to CSV and import into mongo as described in this article CSV Import however, it's very likely that your schema is going to be different in NoSQL compared to MySQL; 您可以执行类似导出到CSV并导入到mongo的操作,如本文所述CSV导入,但是,与MySQL相比,NoSQL中的模式很可能与NoSQL不同; so it's really worth designing your schema to fit the data then migrate over. 所以真的值得设计你的架构以适应数据然后迁移。

Try this: 尝试这个:

Automated export/import using r2n mappings: https://github.com/virtimus/mysql2mongo 使用r2n映射自动导出/导入: https//github.com/virtimus/mysql2mongo

You can use mongify http://mongify.com/ This will reduce the labour all u need to give is database credentials 您可以使用mongify http://mongify.com/这将减少您需要提供的数据库凭据

And its opensource too 它的开源也是如此

A really simple, but imperfect (due to structural differences), way to do this is to use MongoVue . 一个非常简单但不完美(由于结构差异),这样做的方法是使用MongoVue The import tool costs $35 (not included in the free version). 导入工具的成本为35美元(不包括在免费版本中)。 I have only used this to import data from SQL Server to MongoDB, but I have got good results very quickly this way. 我只用它来将数据从SQL Server导入MongoDB,但是我用这种方式很快就得到了很好的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM