Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to migrate/shift/copy/move data in Neo4j

Does any one know how to migrate data from one instance of Neo4j to another. To be more precise, I want to know, how to move the data from one instance of Neo4j on my local machine to another on remote machine. Does any one have any idea about it.

I'm working on my windows machine with Eclipse and Embedded Neo4j . I need to transfer this data to remote Neo4j instance on a Centos machine. Please help me with this.

like image 987
Vineel Avatar asked Feb 07 '14 22:02

Vineel


People also ask

What is the general format of import and export data in Neo4j?

One of the most common formats of data is in rows and columns on flat files. This spreadsheet format is used for a variety of imports and exports to/from relational databases, so it is easy to retrieve existing data this way. You can also use this format of data for Neo4j!

How is data distributed in Neo4j?

With Neo4j 4.0, the customer decides how to split up, or shard, their data into multiple databases, or sub-graphs, that can run on separate systems but be queried as a single entity through the new Fabric server.

How can I improve my Neo4j performance?

Heap Sizing The size of the available heap memory is an important aspect for the performance of Neo4j. Generally speaking, it is beneficial to configure a large enough heap space to sustain concurrent operations. For many setups, a heap size between 8G and 16G is large enough to run Neo4j reliably.


1 Answers

Not sure how to do it for "embedded neo4j db". But for standalone and in case you have something like the command line tool "Putty" on your windows machine, this should work. Instead of $NEO4j_HOME you can also use the normal path without the env variable.

$NEO4J_HOME/bin/neo4j stop

cd $NEO4J_HOME/data
tar -cvf graph.db.tar graph.db
gzip graph.db.tar

scp -i ~/some_path/key_for_remote_server.pem ./graph.db.tar.gz username@your_remote_domeain.com:~/

ssh -i ~/some_path/key_for_remote_server.pem/ username@your_remote_domeain.com

On your remote server (at least this works for ubuntu): Maybe you need to use "sudo" (prefix the commands with sudo).

mv ./graph.db.tar.gz /some_path/
cd /some_path/
gunzip graph.db.tar.gz
tar -xvf graph.db.tar

$NEO4J_HOME/bin/neo4j start
$NEO4J_HOME/bin/neo4j status
like image 98
Roman Avatar answered Oct 01 '22 08:10

Roman