Data cannot be queried after it was imported by neo4j-admin

Please keep the following things in mind:

  1. did you search for what you want to ask before posting?
  2. please use tags for additional info
  3. use a self-descriptive title

Please format code + Cypher statements with the code </> icon, it's much easier to read.

Please provide the following information if you ran into a more serious issue:

  • neo4j version, desktop version, browser version
    4.0.4
    https://github.com/neo4j-contrib/neo4j-helm

  • what kind of API / driver do you use

  • screenshot of PROFILE or EXPLAIN with boxes expanded (lower right corner)

  • a sample of the data you want to import

  • which plugins / extensions / procedures do you use

  • neo4j.log and debug.log

Hi admin,

My neo4j was installed by helm chart.
I followed the guide here https://neo4j.com/docs/operations-manual/current/tutorial/import-tool/
However, I cannot query the data in cypher shell.
How can I make the data returned by the query?

Need more details. Are you able to see the nodes, relationships and properties in the window. What exact query you used ?

I am using shell and did not set up the UI as the neo4j run on kubetnetes.

The query was very simple

match (n) return n;

I imported the data to neo4j database and changed the file ownership to neo4j

You're running Neo4j 4.0.x, so the database data was created, but an entry for that database has not yet been created.

In Neo4j Browser, :use system to switch to the system db, then use CREATE DATABASE <databasename>, (excluding brackets of course) where the database name is the name you used during the import.

Then you should be able to see and switch to the database in question.

hi Andew, thx for your reply.
I imported the data into "neo4j" database which is a default one.

Keep in mind you can only use neo4j-admin import for a brand new database, not an existing one, though I think that would have thrown errors in that case.

If you check the directory within /databases/data/neo4j/ and examine files and their sizes, does that show populated store files, enough to suggest that this is the populated db from the import?

When you log into Neo4j, what database are you connected to? If you change to the system db and query SHOW DATABASES what does this show for neo4j?

1 Like

Before importing data, I have cleared up all data under neo4j database.

neo4j@system> show databases;
+---------------------------------------------------------------------------------------------------------------------------------------------+
| name | address | role | requestedStatus | currentStatus | error | default |
+---------------------------------------------------------------------------------------------------------------------------------------------+
| "neo4j" | "c0-neo4j-core-0.c0-neo4j.default.svc.cluster.local:7687" | "follower" | "online" | "online" | "" | TRUE |
| "neo4j" | "c0-neo4j-core-1.c0-neo4j.default.svc.cluster.local:7687" | "follower" | "online" | "online" | "" | TRUE |
| "neo4j" | "c0-neo4j-core-2.c0-neo4j.default.svc.cluster.local:7687" | "leader" | "online" | "online" | "" | TRUE |
| "neo4j" | "10.42.0.1:7687" | "read_replica" | "online" | "store copying" | "" | TRUE |
| "neo4j" | "10.40.0.3:7687" | "read_replica" | "online" | "store copying" | "" | TRUE |

This is a cluster environment, so you need to make sure you seed the database to all core nodes in the cluster, not just a single node, before you start neo4j back up.

I found a doc here https://neo4j.com/docs/operations-manual/current/clustering/seed/

I imported the data to one node, shall I make manual seed import to other core nodes?
I thought the core will sync the data on its own.

The dataset I imported could be very large.

Yes, follow the instructions in the linked documentation to dump the imported db and load into the other core members to seed the cluster, then bring the cluster online.

For the future, it may be better to import on a separate instance (especially if your cluster is already serving other databases), then dump the db for seeding to the cluster.

Hi Andrew, we ran into a circled situation.
In the "seed to cluster" doc, it required to stop the neo4j server and execute "neo4j-admin unbind".
The container was started by "neo4j console" and there is no way to stop the neo4j server.
If we cannot stop the neo4j server, how can we unbind the core and seed the data?

You would need to terminate the Java process hosting neo4j to stop it.

We don't recommend using neo4j console to start neo4j, please use neo4j start if possible.