Data import from relational databases to Neo4j.
Download & unzip the latest neo4j-etl-components.zip.
Once unzipped, download the proper JDBC Driver (here) and add it to the lib
folder.
./bin/neo4j-etl export \ --rdbms:url <url> --rdbms:user <user> --rdbms:password <password> \ --destination $NEO4J_HOME/data/databases/graph.db/ --import-tool $NEO4J_HOME/bin \ --csv-directory /tmp/northwind
./bin/neo4j-etl export \ --rdbms:url <url> --rdbms:user <user> --rdbms:password <password> --rdbms:schema <schema> \ --using { bulk:neo4j-import | cypher:neo4j-shell | cypher:shell | cypher:direct } \ --neo4j:url <neo4j url> --neo4j:user <neo4j user> --neo4j:password <neo4j password> \ --destination $NEO4J_HOME/data/databases/graph.db/ --import-tool $NEO4J_HOME/bin \ --csv-directory /tmp/northwind --options-file ./import-tool-options.json --force --debug
For detailed usage see also the: tool documentation.
To run the command line tool, once you cloned the project, build the project locally.
From the root directory, run:
git clone https://github.com/neo4j-contrib/neo4j-etl-components cd neo4j-etl-components mvn clean package -DskipTests
Once that has been successfully executed, the scripts are located in the neo-etl-cli/bin
directory.
This tool is licensed under the GPLv3.
-
You can raise GitHub issues or send feedback to feedback@neo4j.com
-
Please also join our neo4j-users Slack and ask in the #help-import channel
We’re welcoming all contributions.
-
Please first raise an issue so that we can discuss your ideas and avoid duplicate work
-
Send your changes as a pull request
-
Make sure to provide tests with your changes
-
JDBC Driver:
Vendor | JDBC Driver URL |
---|---|
http://www.oracle.com/technetwork/database/features/jdbc/default-2280470.html |
|
https://www.microsoft.com/en-us/download/details.aspx?id=55539 |
Northwind database scripts are downloaded from https://code.google.com/archive/p/northwindextended/downloads
You can run the tests with
You will need a RDBMS user neo4j
with password neo4j
with admin privileges to run the tests.
To run the tests in AWS, you’ll need an AWS IAM user.
To run the tests using a local instance:
neo4j
identified by password neo4j
MySQL:
CREATE USER 'neo4j'@'localhost' IDENTIFIED BY 'neo4j'; GRANT ALL PRIVILEGES ON *.* TO 'neo4j'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES;
PostgreSQL:
CREATE USER neo4j WITH SUPERUSER ENCRYPTED PASSWORD 'neo4j';
Oracle:
CREATE USER neo4j IDENTIFIED BY neo4j; GRANT DBA TO neo4j;
For Oracle, you’ll need to add the Oracle Driver to your local Maven repository manually:
mvn install:install-file -Dfile={Path/to/your/ojdbc7.jar} \ -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0.2 -Dpackaging=jar
Microsoft SQL:
Currently the integration tests use the default user "sa".
To run the tests locally:
mvn -P integration-test clean test
To run the tests using Vagrant:
mvn -P integration-test -D PLATFORM=vagrant clean test
To run the tests using AWS:
Note: You need to create AWS Keypair and have the credentials file created to do this
mvn -P integration-test -D PLATFORM=aws -D EC2_SSH_KEY=<name of your EC2 SSH key> clean test
Set of tests that are part of the neo4j-etl-it
module.
However, they are skipped usually when you run the integration-test target by default. You can run them separately as part of a test suite.
To run performance tests locally:
mvn -P performance-test clean dependency:copy-dependencies test -D failIfNoTests=false -D EC2_SSH_KEY=<name of your EC2 SSH key>
To run performance tests in AWS:
mvn -P performance-test clean dependency:copy-dependencies test -D PLATFORM=aws -D failIfNoTests=false -D EC2_SSH_KEY=<name of your EC2 SSH key>