floatingpurr
floatingpurr

Reputation: 8559

Restore neo4j graph from a huge dump

I have a huge dump of my graph in a file (i.e. 550k lines of CRATEs) and I need to restore it. I tried from terminal

neo4j-shell -file backup.cypher

...but after 24 hours the transaction was not committed, then I stopped it.

Is there another way to restore my data?

Upvotes: 1

Views: 278

Answers (2)

Michael Hunger
Michael Hunger

Reputation: 41676

Split up the creates into individual ones, separated by semicolon. then wrap 50k of them each into a begin ... commit block.

for the relationships, change them to a match + match + create statement to find the two nodes and create the relationship.

Upvotes: 1

MicTech
MicTech

Reputation: 45043

You can split your dump file to multiple files and run restore for each of it.

But be aware there could be references between CREATE clauses.

Upvotes: 2

Related Questions