Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Neo4j Import Tool to add data to existing database

Tags:

neo4j

I am using the Neo4j Import Tool to import large datasets to my existing graph. When importing .csv data to my graph i get

Directory '...' already contains a database.

Github suggests the following solution:

"If you see Input error: Directory 'neo4j-community-
3.0.3/data/databases/graph.db' already contains a database, delete the 
graph.db directory and try again."

So I have to delete my graph and a new one will be created. I tryed - it works.

But how can I add Data to an existing database, so without deleting mine?

Thanks!

like image 545
Grapheneer Avatar asked Aug 21 '17 14:08

Grapheneer


People also ask

What format is required to load the data using existing Neo4j tooling?

Using the neo4j-admin import tool With this type of import, the source data is in CSV format. The benefit of importing with this tool is that it is much faster than doing it with Cypher, APOC, or via a driver. The database is created as part of the import and it is done "offline".

What command you will use to upload a CSV file into Neo4j database?

To import data from a CSV file into Neo4j, you can use LOAD CSV to get the data into your query. Then you write it to your database using the normal updating clauses of Cypher. A new node with the Artist label is created for each row in the CSV file.

What are some options for loading data into Neo4j?

By default, this database is set to neo4j , but you can use the --database=<database> option to import your data into a different database. The user running neo4j-admin import must have WRITE capabilities into dbms. directories. data and dbms.


1 Answers

Import tool is only for newly created databases.

You can use LOAD CSV cypher command to load into an existing database. Other tricks are here: https://neo4j.com/developer/guide-import-csv/

like image 152
szenyo Avatar answered Nov 09 '22 01:11

szenyo