Search code examples
neo4jgraphenedb

Importing Neo4J Database from GrapheneDB to Local


I have created an app that uses a Neo4J database. I developed a local instance in Windows, purchased some space on a development GrapheneDB server, migrated my database, and had a few users test out my app. There are a few issues in my application that I wish to debug. I want to do development on a copy of their data only on my local instance of Neo4j. GrapheneDB offers the ability to download a graph.db.zip file that contains the contents of the database. How do I import this file using Neo4j desktop? It appears Neo4J desktop only imports csv files. I tried overwriting the graph.db folder with the contents of the zip file and my database doesn't appear in my Neo4J desktop. How do I import my GrapheneDB to my local?


Solution

  • Two approaches that are probably fairly similar under the hood:

    Use neo4j-admin

    • Create a local graph in Neo4j Desktop
      • I used the same graph name as I'd used in Graphene
      • Make sure the database version is the same as is in Graphene
    • Do not start the database yet but instead click Manage, then the Terminal tab
    • Unzip the contents of the graphdb.zip file somewhere local - say, C:\Temp\graphdb for this example
    • Run neo4j-admin restore --from="C:\temp\graphdb"
    • Start the database using Neo4j Desktop
    • You should have a working database

    File copying by hand

    • Create a local graph in Neo4j Desktop
      • I used the same graph name as I'd used in Graphene
      • Make sure the database version is the same as is in Graphene
    • Do not start the database yet but instead click Manage, then Open Folder
    • Enter the databases folder - it should be empty
    • Create a new folder called graph.db (the name needs to be exact)
    • Copy the contents of the graphdb.zip file into the new graph.db folder
    • Start the database using Neo4j Desktop
    • You should have a working database

    I tested this on a graph with only one node, but it did work - I suspect the database version matching is pretty vital.