{"id":1538,"date":"2013-02-15T08:40:56","date_gmt":"2013-02-15T13:40:56","guid":{"rendered":"http:\/\/www.migrate2cloud.com\/blog\/?p=1538"},"modified":"2016-03-21T02:48:13","modified_gmt":"2016-03-21T07:48:13","slug":"migrate-mysql-database-to-mongodb","status":"publish","type":"post","link":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/","title":{"rendered":"Migrate Mysql database to Mongodb"},"content":{"rendered":"<p>In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the more notable NoSQL projects out there is MongoDB, an open source document-oriented database that stores data in collections of JSON-like documents. What sets MongoDB apart from other NoSQL databases is its powerful document-based query language, which makes the transition from a relational database to MongoDB easy because the queries translate quite easily.<\/p>\n<p>This new class of databases seems to solve many of the bottlenecks in MySql and other relational databases. It will give you shear performance, self replication and scalability at not cost because it open source. MongoDB has plenty of drivers for other scripting and high-level languages I use PHP so I download the PHP driver. You can see the supported list here: <a href=\"http:\/\/www.mongodb.org\/display\/DOCS\/Drivers\" target=\"_blank\">http:\/\/www.mongodb.org\/display\/DOCS\/Drivers<\/a>. In this blog I convert\u00a0 a MySQL database using PHP to MongoDB.<\/p>\n<p>First you install MongoDB, you can do it by checking the previous blog.\u00a0 Check this <a href=\"http:\/\/www.migrate2cloud.com\/blog\/installation-of-mongodb-and-its-performance-test\" target=\"_blank\">link<\/a><\/p>\n<p>Then we run the script to convert a Mysql DB to Mongodb.<\/p>\n<p>create a new file called <strong>MySqltoMongodb.php , In that file please copy paste the below contants (please give your Mysql DB details as well as your Mongodb details)<\/strong><\/p>\n<ol>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>&lt;?php<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\/\/ mysql settings<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$mydb = \u201cdatabase\u201d;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$myconn = <a href=\"http:\/\/www.php.net\/mysql_connect\"><span style=\"color: #3366ff;\">mysql_connect<\/span><\/a>(\u2018localhost\u2019,&#8217;user\u2019,&#8217;password\u2019);<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$setmydb = <a href=\"http:\/\/www.php.net\/mysql_select_db\"><span style=\"color: #3366ff;\">mysql_select_db<\/span><\/a>( $mydb );<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$mytables = getMyTables( $mydb );<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0\/\/mongo db settings<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$modb = \u201cdatabase\u201d;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$moConnect=\u201dmongodb:\/\/user:password@localhost\u201d;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0function getMyTables( $dbname ) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$tables = <a href=\"http:\/\/www.php.net\/array\"><span style=\"color: #3366ff;\">array<\/span><\/a>();<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$sql = <a href=\"http:\/\/www.php.net\/mysql_query\"><span style=\"color: #3366ff;\">mysql_query<\/span><\/a>(\u201cSHOW TABLES FROM $dbname \u201c) or <a href=\"http:\/\/www.php.net\/die\"><span style=\"color: #3366ff;\">die<\/span><\/a>(\u201cError getting tables from $dbname\u201d);<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0if( <a href=\"http:\/\/www.php.net\/mysql_num_rows\"><span style=\"color: #3366ff;\">mysql_num_rows<\/span><\/a>( $sql ) &gt; 0 ) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>while( $table = <a href=\"http:\/\/www.php.net\/mysql_fetch_array\"><span style=\"color: #3366ff;\">mysql_fetch_array<\/span><\/a>( $sql ) ) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$explain = explainMyTable( $table[0] );<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$tables[$table[0]] = $explain;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>return $tables;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0function explainMyTable( $tbname ) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$explain = <a href=\"http:\/\/www.php.net\/array\"><span style=\"color: #3366ff;\">array<\/span><\/a>();<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$sql = <a href=\"http:\/\/www.php.net\/mysql_query\"><span style=\"color: #3366ff;\">mysql_query<\/span><\/a>(\u201cEXPLAIN $tbname\u201d) or <a href=\"http:\/\/www.php.net\/die\"><span style=\"color: #3366ff;\">die<\/span><\/a>(\u201cError getting table structure\u201d);<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$i = 0;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0while( $get = <a href=\"http:\/\/www.php.net\/mysql_fetch_array\"><span style=\"color: #3366ff;\">mysql_fetch_array<\/span><\/a>( $sql ) ) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong><a href=\"http:\/\/www.php.net\/array_push\"><span style=\"color: #3366ff;\">array_push<\/span><\/a>( $explain, $get[0] );<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$i++;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>return $explain;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0function checkEncode($string) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>if( !mb_check_encoding($string,\u2019UTF-8\u2032)) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>return <a href=\"http:\/\/www.php.net\/mb_convert_encoding\"><span style=\"color: #3366ff;\">mb_convert_encoding<\/span><\/a>($string,\u2019UTF-8\u2032,\u2019ISO-8859-1\u2032);<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>} else {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>return $string;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>try {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$moconn = new Mongo($moConnect);<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$modb = $moconn-&gt;selectDB( $modb );<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>} catch(MongoConnectionException $e) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong><a href=\"http:\/\/www.php.net\/die\"><span style=\"color: #3366ff;\">die<\/span><\/a>($e.\u201dProblem during mongodb initialization. Please start mongodb server.\u201d);<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0foreach( $mytables as $table =&gt; $struct ) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$sql = <a href=\"http:\/\/www.php.net\/mysql_query\"><span style=\"color: #3366ff;\">mysql_query<\/span><\/a>(\u201cSELECT * FROM $table LIMIT 0 , 500000\u2033) or <a href=\"http:\/\/www.php.net\/die\"><span style=\"color: #3366ff;\">die<\/span><\/a>( <a href=\"http:\/\/www.php.net\/mysql_error\"><span style=\"color: #3366ff;\">mysql_error<\/span><\/a>() );<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$count = <a href=\"http:\/\/www.php.net\/mysql_num_rows\"><span style=\"color: #3366ff;\">mysql_num_rows<\/span><\/a>( $sql );<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0\/\/ Starts new collection on mongodb<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$collection = $modb-&gt;$table;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0\/\/ If it has content insert all content<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>if( $count &gt; 0 ) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>while( $info = <a href=\"http:\/\/www.php.net\/mysql_fetch_array\"><span style=\"color: #3366ff;\">mysql_fetch_array<\/span><\/a>( $sql, MYSQL_NUM )) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$infosize = <a href=\"http:\/\/www.php.net\/count\"><span style=\"color: #3366ff;\">count<\/span><\/a>( $info );<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$mosql = <a href=\"http:\/\/www.php.net\/array\"><span style=\"color: #3366ff;\">array<\/span><\/a>();<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0for( $i=0; $i &lt; $infosize; $i++ ) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>if(!<a href=\"http:\/\/www.php.net\/empty\"><span style=\"color: #3366ff;\">empty<\/span><\/a>($struct[$i]))<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$mosql[$struct[$i]] = checkEncode($info[$i]);<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0$collection-&gt;insert($mosql);<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\/\/ Only create a new entry empty<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>} else {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0for( $i=0; $i &lt; $infosize; $i++ ) {<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>if(!<a href=\"http:\/\/www.php.net\/empty\"><span style=\"color: #3366ff;\">empty<\/span><\/a>($struct[$i]))<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$mosql[$struct[$i]] = \u201d;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>\u00a0}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>$collection-&gt;insert($mosql);<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>}<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong><a href=\"http:\/\/www.php.net\/echo\"><span style=\"color: #3366ff;\">echo<\/span><\/a> \u201cDone! Please, check your MongoDB collection!\u201d;<\/strong><\/span><\/div>\n<\/li>\n<li>\n<div><span style=\"color: #3366ff;\"><strong>?&gt;<\/strong><\/span><\/div>\n<\/li>\n<\/ol>\n<p>Now fire up your browser and launch the page. If all goes well you should see<br \/>\n<strong>\u201cDone! Please, check your MongoDB collection!\u201d<\/strong><\/p>\n<p>After running this script check your Mongo db collection, in that you can see your Mysql Table.\u00a0 However we haven&#8217;t done it on a large system, we are planning to do the same on a huge Postgres Sql system soon.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.migrate2cloud.com\/blog\/wp-content\/uploads\/2013\/02\/MySql1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1541\" src=\"http:\/\/www.migrate2cloud.com\/blog\/wp-content\/uploads\/2013\/02\/MySql1.png\" alt=\"\" width=\"836\" height=\"404\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\n","protected":false},"excerpt":{"rendered":"<p>In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[3],"tags":[269,143,261,266,264,272,262,265,270,121,119,271,120,86,267,134,274,273,268,263],"class_list":["post-1538","post","type-post","status-publish","format-standard","hentry","category-cloud-computing","tag-bookdatabases-theoretical-introduction","tag-company-mysql-ab","tag-data-management","tag-database","tag-database-management-systems","tag-database-software","tag-distributed-computing-architecture","tag-document-oriented-database","tag-json","tag-migration","tag-mongodb","tag-mongodb-server","tag-mysql-2","tag-nosql","tag-odb","tag-php","tag-php-driver","tag-relational-database","tag-rethinkdb","tag-structured-storage"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"bobinson\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Migrate to Cloud - we make the clouds rain\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Migrate Mysql database to Mongodb - Migrate to Cloud\" \/>\n\t\t<meta property=\"og:description\" content=\"In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-02-15T13:40:56+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2016-03-21T07:48:13+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Migrate Mysql database to Mongodb - Migrate to Cloud\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#blogposting\",\"name\":\"Migrate Mysql database to Mongodb - Migrate to Cloud\",\"headline\":\"Migrate Mysql database to Mongodb\",\"author\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/bobinson\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/02\\\/MySql1.png\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#articleImage\",\"width\":1393,\"height\":674},\"datePublished\":\"2013-02-15T08:40:56-05:00\",\"dateModified\":\"2016-03-21T02:48:13-05:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#webpage\"},\"articleSection\":\"Cloud computing, Book:Databases \\\/\\\/ Theoretical Introduction, Company: MySQL AB, Data management, Database, Database management systems, database software, Distributed computing architecture, Document-oriented database, JSON, Migration, Mongodb, mongodb server, Mysql, NoSql, ODB, PHP, PHP driver, relational database, RethinkDB, Structured storage\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/category\\\/cloud-computing\\\/#listItem\",\"name\":\"Cloud computing\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/category\\\/cloud-computing\\\/#listItem\",\"position\":2,\"name\":\"Cloud computing\",\"item\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/category\\\/cloud-computing\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#listItem\",\"name\":\"Migrate Mysql database to Mongodb\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#listItem\",\"position\":3,\"name\":\"Migrate Mysql database to Mongodb\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/category\\\/cloud-computing\\\/#listItem\",\"name\":\"Cloud computing\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#organization\",\"name\":\"Migrate to Cloud\",\"description\":\"we make the clouds rain\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/bobinson\\\/#author\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/bobinson\\\/\",\"name\":\"bobinson\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/75ccdce824303bc4f61f39dec0a643a767f9bda27d54a85334ab60120544971f?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"bobinson\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#webpage\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/\",\"name\":\"Migrate Mysql database to Mongodb - Migrate to Cloud\",\"description\":\"In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/migrate-mysql-database-to-mongodb\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/bobinson\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/author\\\/bobinson\\\/#author\"},\"datePublished\":\"2013-02-15T08:40:56-05:00\",\"dateModified\":\"2016-03-21T02:48:13-05:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/\",\"name\":\"Migrate to Cloud\",\"description\":\"we make the clouds rain\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.migrate2cloud.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Migrate Mysql database to Mongodb - Migrate to Cloud","description":"In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the","canonical_url":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#blogposting","name":"Migrate Mysql database to Mongodb - Migrate to Cloud","headline":"Migrate Mysql database to Mongodb","author":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/author\/bobinson\/#author"},"publisher":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.migrate2cloud.com\/blog\/wp-content\/uploads\/2013\/02\/MySql1.png","@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#articleImage","width":1393,"height":674},"datePublished":"2013-02-15T08:40:56-05:00","dateModified":"2016-03-21T02:48:13-05:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#webpage"},"isPartOf":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#webpage"},"articleSection":"Cloud computing, Book:Databases \/\/ Theoretical Introduction, Company: MySQL AB, Data management, Database, Database management systems, database software, Distributed computing architecture, Document-oriented database, JSON, Migration, Mongodb, mongodb server, Mysql, NoSql, ODB, PHP, PHP driver, relational database, RethinkDB, Structured storage"},{"@type":"BreadcrumbList","@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.migrate2cloud.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/#listItem","name":"Cloud computing"}},{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/#listItem","position":2,"name":"Cloud computing","item":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#listItem","name":"Migrate Mysql database to Mongodb"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#listItem","position":3,"name":"Migrate Mysql database to Mongodb","previousItem":{"@type":"ListItem","@id":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/#listItem","name":"Cloud computing"}}]},{"@type":"Organization","@id":"https:\/\/www.migrate2cloud.com\/blog\/#organization","name":"Migrate to Cloud","description":"we make the clouds rain","url":"https:\/\/www.migrate2cloud.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.migrate2cloud.com\/blog\/author\/bobinson\/#author","url":"https:\/\/www.migrate2cloud.com\/blog\/author\/bobinson\/","name":"bobinson","image":{"@type":"ImageObject","@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/75ccdce824303bc4f61f39dec0a643a767f9bda27d54a85334ab60120544971f?s=96&d=mm&r=g","width":96,"height":96,"caption":"bobinson"}},{"@type":"WebPage","@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#webpage","url":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/","name":"Migrate Mysql database to Mongodb - Migrate to Cloud","description":"In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/#breadcrumblist"},"author":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/author\/bobinson\/#author"},"creator":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/author\/bobinson\/#author"},"datePublished":"2013-02-15T08:40:56-05:00","dateModified":"2016-03-21T02:48:13-05:00"},{"@type":"WebSite","@id":"https:\/\/www.migrate2cloud.com\/blog\/#website","url":"https:\/\/www.migrate2cloud.com\/blog\/","name":"Migrate to Cloud","description":"we make the clouds rain","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.migrate2cloud.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Migrate to Cloud - we make the clouds rain","og:type":"article","og:title":"Migrate Mysql database to Mongodb - Migrate to Cloud","og:description":"In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the","og:url":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/","article:published_time":"2013-02-15T13:40:56+00:00","article:modified_time":"2016-03-21T07:48:13+00:00","twitter:card":"summary_large_image","twitter:title":"Migrate Mysql database to Mongodb - Migrate to Cloud","twitter:description":"In recent years, we have seen a growing interest in database management systems that differ from the traditional relational model. At the heart of this is the concept of NoSQL, a term used collectively to denote database software that does not use the Structured Query Language (SQL) to interact with the database. One of the"},"aioseo_meta_data":{"post_id":"1538","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2022-12-27 09:26:05","updated":"2026-07-21 15:32:12","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.migrate2cloud.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/\" title=\"Cloud computing\">Cloud computing<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMigrate Mysql database to Mongodb\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.migrate2cloud.com\/blog"},{"label":"Cloud computing","link":"https:\/\/www.migrate2cloud.com\/blog\/category\/cloud-computing\/"},{"label":"Migrate Mysql database to Mongodb","link":"https:\/\/www.migrate2cloud.com\/blog\/migrate-mysql-database-to-mongodb\/"}],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/posts\/1538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/comments?post=1538"}],"version-history":[{"count":16,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/posts\/1538\/revisions"}],"predecessor-version":[{"id":2134,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/posts\/1538\/revisions\/2134"}],"wp:attachment":[{"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/media?parent=1538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/categories?post=1538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.migrate2cloud.com\/blog\/wp-json\/wp\/v2\/tags?post=1538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}