Migrate cubrid to mysql
JavaScript
Switch branches/tags
Nothing to show
Latest commit 0d727eb May 13, 2013 @iamdenny iamdenny Update Migrator.js
license updated
Permalink
Failed to load latest commit information.
lib Update Migrator.js May 13, 2013
.gitingore first commit Jan 4, 2013
README.md Update README.md May 13, 2013
index.js first commit Jan 4, 2013
package.json v0.1.0 Jan 7, 2013

README.md

Migrate-Cubird-To-Mysql

Migrate cubird to mysql.

How to Install

NPM

npm install migrate-cubrid-to-mysql

GIT

git clone https://github.com/iamdenny/migrate-cubird-to-mysql.git

How to use

Make tables schema on Mysql same as tables schema on Cubrid first.

app.js

var Mcm = require('migrate-cubird-to-mysql');
var htCubrid = {
    sHostname : '127.0.0.1',
    sUser : 'username',
    sPassword : 'password',
    nPort : 1527,
    sDatabase : 'database'
};
var htMysql = {
    sHostname : '127.0.0.1',
    sUser : 'username',
    sPassword : 'password',
    nPort : 3306,
    sDatabase : 'database',
    bDebug : false
};
var oMcm = new Mcm(htCubrid, htMysql);

oMcm.once('connected', function(){
	// first arg : oracle query
	// second arg : mysql table name
	// third arg : truncate(delete data from mysql table)
	// forth arg : callback
    oMcm.migrateByQuery("SELECT * FROM user", 'user', true, function(htResult){
          console.log('First migration is done', htResult);
      });

    oMcm.migrateByQuery("SELECT * FROM group", 'group', true, function(htResult){
          console.log('Second migration is done', htResult);
      });
    
    oMcm.migrateByQuery("SELECT * FROM article", 'article', true, function(htResult){
          console.log('Thrid migration is done', htResult);
      });      
}).once('done', function(htResult){
    console.log('All done', htResult);
    process.exit(0);
});

Execute

node app.js

License

MIT License

Copyright 2013 NHN Corp.