Using the Neo4j ETL Tool for Import
About this module
You have learned how to import data into the graph using Cypher, APOC, the neo4j-admin tool, and also using a client application.
Another way that you can import data into the graph is with the Neo4j ETL Tool.
At the end of this module, you should be able to:
-
Create a connection to a live RDBMS.
-
Customize mappings from the RDBMS to the graph.
-
Import data from the RDBMS to the graph.
Why use the Neo4j ETL Tool for the import?
-
The Neo4j ETL Tool requires that both the source RDBMS and the target DBMS are online.
-
It enables you to control how much of the data in an existing RDBMS will be imported into the graph.
-
It also enables you to customize how nodes and relationships will be created in the graph.
Steps for importing with the ETL Tool
-
Install the Neo4j ETL Tool into your Neo4j Desktop project.
-
Create and start the Neo4j database into which you will import the data.
-
Use the Neo4j ETL Tool to import the data:
-
Specify and test the RDBMS connection.
-
Prepare for mapping
-
View the default mapping to be performed.
-
Optionally, modify the default mapping.
-
Perform the import.
-
Install the Neo4j ETL Tool
In Neo4j Desktop, you either create or view a project that you have created. Then you simply click the Add Application icon to add the Neo4j ETL Tool.

Here is what your project should look like with the Neo4j ETL Tool added:

Make sure that you have updated Neo4j Desktop so that it has the latest version of the ETL Tool. At this writing, the latest version is 1.5.0. |
Create and start the Neo4j instance
To import using the Neo4j ETL Tool, the Neo4j graph into which you will import the data must be started. For a new project, we simply click add graph and start a new Neo4j instance.

You can skip this step if you plan to use an existing project that already has a Neo4j instance running. |
Create the database you will import data into
You will most likely be importing the data into a newly-created database.
create database customers;
show databases

Next, you are ready to use the Neo4j ETL Tool for import.
Starting the Neo4j ETL Tool
Here is the initial page you see when you start the Neo4j ETL tool:

The first thing you should do is connect to the RDBMS.
Connecting to the RDBMS
Here is an example where we are providing the connection information for an existing RDBMS from which we will be retrieving data for the import.

Connection tested and saved
You must test and save the RDBMS connection to ensure the Neo4j ETL Tool will be able to access the RDBMS.

Prepare for mapping
After you have connected to the RDBMS, you must select the Neo4j Desktop project and the Neo4j instance to use for the mapping.

You then click START MAPPING to begin the mapping.
Successful mapping
If the Neo4j ETL Tool can successfully derive a mapping from the RDBMS, you will see a message that the mapping was successful. You can clear the message and then click NEXT.

Default node mapping
For the northwind RDBMS, here is the default mapping that could be used to import the nodes.

Changing node labels and what data will be imported
In the node tab, you can change the name that node labels will have and also skip data to be imported.

Changing node properties
You can even change what properties will be imported, their names, and types by selecting the edit icon for a node.

Changing relationship types
You can modify the names of relationships and if they will be skipped upon import.

Saving the mapping
After your customization of the mapping, you should always save it.

Then you click NEXT to continue to the import.
Select the database for import
Before you import, you must select the currently started database that you want to import the data into.

Exercise 20: Importing data using Neo4j ETL Tool
-
Create a new database in an existing project named northwind.
-
Install Neo4j ETL Tool for the project.
-
Restart the Neo4j instance.
-
Configure a JDBC connection with these guidelines:
-
database name: northwind
-
host: db-examples.cmlvojdj5cci.us-east-1.rds.amazonaws.com
-
user: n4examples
-
password: 36gdOVABr3Ex
-
-
Import the data into the northwind database.
You will only be able to perform the steps of this exercise if you use Neo4j Desktop.
Estimated time to complete: 10 minutes.
Check your understanding
Question 1
What type of connection to the RDBMS is used for importing from an RDBMS with the Neo4j ETL Tool?
Select the correct answer.
-
Java
-
ODBC
-
JDBC
-
Bolt
Summary
You should now be able to:
-
Create a connection to a live RDBMS.
-
Customize mappings from the RDBMS to the graph.
-
Import data from the RDBMS to the graph.
Need help? Ask in the Neo4j Community