mysqltomongdb

it is php class which use for import database from mysql to mongodb
1 follower

$mysql_host = "localhost"; $mysql_user = "root"; $mysql_pswd = "root"; $mysql_database = "yii2advanced";

$mongo_host = "localhost"; $mongo_user = ""; $mongo_pswd = ""; $mongo_database = "yii2advanced";

$imp = new MySqlToMongo(); //Establishing connections to mysql and mongo instances $imp->mysql_connect($mysql_host, $mysql_user, $mysql_pswd, $mysql_database); $imp->mongodb_connect($mongo_host, $mongo_user, $mongo_pswd, $mongo_database);

//Set the number of concurrent records to insert //$imp->setNumRecords(1000);

//Set debug mode to read debug messages $imp->setDebugMode(true);

//Get all tables from the database //if you want to import single tables just pass an array of names ex: $list("tbl1","tbl2") $tables = $imp->getMySqlTables();

//Set the dropping tables if exists into mongo. If false it will append records $imp->setDropIfExists(true);

//Starting import session $imp->import($tables);

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet
  • Yii Version: all
  • License: Other Open Source License
  • Developed by: bhaiyyalal
  • Category: Database
  • Votes: No votes yet
  • Downloaded: 0 times
  • Created on: Sep 6, 2016
  • Last updated: never
  • Tags: MySQL, mo