I wanted to migrate data from Mysql to neo4j. I'm using Neo4j 2.1.2 64 bit installer on 64 bit windows machine.
I followed the blog in the link http://maxdemarzi.com/2012/02/28/batch-importer-part-2/#more-660 where migrating data from postgreSQL is well well explained.
Even I took the same example and created the sames tables in mysql. After creating nodes and relationship tables in mysql, i exported them as a csv file . So that I can use them in the batch import command.
Here all my fields are varchar and row_number() fiels is also a varchar field.
I used the below command to export mysql's relationship table into myrels.csv file (same thing for nodes table):
SELECT *
INTO OUTFILE 'D:/Tech_Explorations/BigData_Related/Neo4j/mqytoneo4j/myrels.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY '\n'
FROM
(
SELECT 'start' AS `start`, 'end' AS `end`,'type' AS `type`,'status' AS `status`
UNION ALL
SELECT `start`, `end`,`type`,`status`
FROM `vouch_rels`
) `sub_query`;
Used below query to load the mynodes.csv and myrels.csv o neo4j:
java -server -Xms1024M -jar D:/Neo4j/target/batch-import-jar-with-dependencies.jar
neo4j/data/graph.db mynodes.csv myrels.csv
When i executed the above batch import query , it's giving me an error saying
Exception in thread "main" java.lang.NumberFormatException: For input string: "1
,"1","python,confirmed"
Where "1,"1","python,confirmed" is row in the myrels.csv.
The above error might be because of some datatype or csv file issue but I'm not able to figure it out. Even I tried with changing different csv load options while loading from mysql to csv file. But still getting the same error.