ruby-on-railsneo4jdumpneo4j.rb

How to dump data with Neo4j.rb


I'm working on Rails project with Neo4j.rb and I have a very basic problem: I'd like to dump my data to file (and next load it back). Unfortunately I can't do this. I tried this command:

neo4j-admin dump --database=<database> --to=<destination-path>

but I got this:

neo4j-admin: command not found

So, how can I solve this problem?


Solution

  • Okay, I solved the problem. We must run neo4j-admin script using its full path, what was in that case db/neo4j/development/bin/neo4j-admin. So, my final solution is:

    db/neo4j/development/bin/neo4j-admin dump --database=graph.db --to=./my_dump
    

    What's maybe important to add: I need my database stopped to do that. We can do this by running rake neo4j:stop, and then restart it by rake neo4j:start.