cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Anyone finding it easy to run neo4j-admin tool import?

glevang
Node Link

Hi

I am new here and just going through importing data in the academy. I am referring to exercise 18 of the neo4j-intro-exercises.

I am struggling to run the neo4j-admin import command in the terminal to import the crimes data using the admin tool. I have followed all the steps and get the following error:

..\bin\neo4j-admin.ps1 : Cannot process argument because the value of         
argument "name" is not valid. Change the value of the "name" argument and run the 
operation again.
    + CategoryInfo          : InvalidArgument: (:) [neo4j-admin.ps1], PSArgumentE 
   xception
    + FullyQualifiedErrorId : Argument,neo4j-admin.ps1

I am not sure which name argument they are referring to. Has anyone come across a similar error and know how to fix it. My command is:

bin\neo4j-admin import --database crimes --nodes crimes_header.csv,crimes.csv --nodes beats.csv --nodes=PrimaryType=primaryTypes.csv -
-relationships crimesBeats.csv --relationships=PRIMARY_TYPE=crimesPrimaryTypes.csv --trim-strings=true > import.out

Regards,
Grant Magne

1 ACCEPTED SOLUTION

Hello @glevang

In the Browser Guide for Exercise 18, there is an extra line feed character in the solution text. The command you enter should enter is:

../bin/neo4j-admin import --database crimes --nodes crimes_header.csv,crimes.csv --nodes beats.csv --nodes=PrimaryType=primaryTypes.csv --relationships crimesBeats.csv --relationships=PRIMARY_TYPE=crimesPrimaryTypes.csv --trim-strings=true > import.out

but.... in trying this on a 4.2.1 database, I received an error: insufficient memory. Apparently in 4.2.1, one needs more heap to perform this import. This course was tested on a previous release (4.1).

Before you perform the import change this setting for the database:

dbms.memory.heap.max_size=2G

I will modify the browser guide to include these instructions for heap.

Elaine

View solution in original post

7 REPLIES 7

Hello @glevang and welcome to the Neo4j community!

I think you might be running the windows shell script inside powershell rather than in the Windows console.

To manage Neo4j from within Powershell, see this page for instructions:

Let me know if that helps.

Best,
ABK

Hi @abk . Thank you for your welcoming message.

Thank you for your answer. I actually ran the command in my DBMS terminal on neo4j desktop.

After reading your message, I tried running it in the windows command line (same error) and then in Powershell as an admin. I don't get an error when running it in Powershell but I don't get any processing output (and the execution is a few seconds). The import.out file is empty.

I followed the Windows Installation Operations Manager as best I can when I downloaded neo4j the first time. I tried following downloading it again but I noticed the download is identical to the version I have (I installed it for the first time a week ago).

I'm not a developer so I'm not sure if I have done something incorrectly in the installation guide. Do I have to run the windows serice commands and powershell module commands each time I start up Powershell/command line?

Kind regards,
Grant Magne

Grant,

What version is the Neo4j database?

Elaine

glevang
Node Link

Hi @elaine.rosenberg

The DBMS is version 4.2.1. I don't have an existing crimes database as per the requirement for using neo4j-admin import tool.

Kind regards,
Grant Magne

Hello @glevang ,

It could be that Desktop's terminal is opening a DOS session. Could you try using the .bat script?

bin\neo4j-admin.bat import --database crimes --nodes crimes_header.csv,crimes.csv --nodes beats.csv --nodes=PrimaryType=primaryTypes.csv -
-relationships crimesBeats.csv --relationships=PRIMARY_TYPE=crimesPrimaryTypes.csv --trim-strings=true > import.out

-ABK

Hello @glevang

In the Browser Guide for Exercise 18, there is an extra line feed character in the solution text. The command you enter should enter is:

../bin/neo4j-admin import --database crimes --nodes crimes_header.csv,crimes.csv --nodes beats.csv --nodes=PrimaryType=primaryTypes.csv --relationships crimesBeats.csv --relationships=PRIMARY_TYPE=crimesPrimaryTypes.csv --trim-strings=true > import.out

but.... in trying this on a 4.2.1 database, I received an error: insufficient memory. Apparently in 4.2.1, one needs more heap to perform this import. This course was tested on a previous release (4.1).

Before you perform the import change this setting for the database:

dbms.memory.heap.max_size=2G

I will modify the browser guide to include these instructions for heap.

Elaine

glevang
Node Link

Hi @elaine.rosenberg

Thank you for your help. Changing that setting led to a successful run in the neo4j terminal.

I did however have to add import\ to all of the csv file names to get it to look in the right directory.

Thank you @abk for your help too. The command you suggested also ran successfully in Powershell after I had changed the dbms memory setting. Again I had to add import\ as a prefix to the csv files.

Kind regards,
Grant Magne

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online