Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a tool to dump a Neo4j graph as Cypher and re-load it from Cypher?

Everyone familiar with MySQL has likely used the mysqldump command which can generate a file of SQL statements representing both the schema and data in a MySQL database. These SQL text files are commonly used for many purposes: backups, seeding replicas, copying databases between installations (- copy prod DBs to staging environments etc) and others.

Is there a similar tool for Neo4j that can dump an entire graph into a text file of Cypher statements, that when executed on an empty database would reconstruct the original data?

Thanks.

like image 801
DavidJ Avatar asked Jul 26 '13 01:07

DavidJ


People also ask

How to load a database dump to a Neo4j instance?

A database dump can be loaded to a Neo4j instance using the load command of neo4j-admin. 1. Command The neo4j-admin load command loads a database from an archive created with the neo4j-admin dump command. Alternatively, neo4j-admin load can accept dump from standard input, enabling it to accept input from neo4j-admin dump or another source.

How to backup Neo4j graph database?

Let’s take Offline backup of Neo4j Graph Database. It is backed up using Neo4j’s admin tool and the service must be stopped for offline backup. db-folder: We write the names of the databases that we will be backing up here. You can find the database names by accessing the folder where the databases are located.

What is the neo4j-admin LOAD command?

The neo4j-admin load command loads a database from an archive created with the neo4j-admin dump command. Alternatively, neo4j-admin load can accept dump from standard input, enabling it to accept input from neo4j-admin dump or another source. The command can be run from an online or an offline Neo4j DBMS.

How do you create a cypher graph?

He has been working on a tool that helps users create, visualize and parse Cypher. The first step in building any graph is to start with a question. When you model that question you get business concepts. From there, you import data and will be able to build your query. Next, it is vital to have a thorough understanding of your tools.


1 Answers

In neo4j version 2 (e.g. 2.0.0M3), using neo4j-shell, you can use the command

dump

which will create the cypher statements (pretty much like mysqldump would do. To read in the file you can use

cat dump.cql | neo4j-shell

like image 60
Joerg Baach Avatar answered Nov 02 '22 04:11

Joerg Baach