Copying a local database from one computer to another ne04j - neo4j

I created a database Neo4j on a PC, with many relationships, node, etc
how to move/ copy the database from this pc to another?
thanks for the help
francesco
update1: I have tried to found conf/neo4j-server.properties but i don't have...
this is a screenshot of my folder ne04j (It is in Windows document Folder)
http://s12.postimg.org/vn4e22s3x/fold.jpg

Neo4J databases live in your filesystem, you can simply make a copy of the folder in which your Neo4J data is stored. If you are running standalone this folder will be configured in conf/neo4j-server.properties and the line will look something like this:
org.neo4j.server.database.location=data/graph.db
Copy the content of that folder to the graph database folder on your other machine. I'd recommend that your databases are not running when you do this.

I believe you're looking for the dump shell command which you can use to export a database into a single Cypher create statement, you'd "dump" the database and then import it on your new machine.
Information on using the command is outlined here: Neo4j docs

A Neo4j database can be dumped and loaded using the following commands:
neo4j-admin dump --database=<database> --to=<destination-path>
neo4j-admin load --from=<archive-path> --database=<database> [--force]
Limitations
The database should be shutdown before running the dump and load commands.
https://neo4j.com/docs/operations-manual/current/tools/dump-load/

i used the above solution, but the file name was different.
in the folder of the neo4j data, look for folder called conf and inside the configuration file called neo4j.conf
inside this file you will see a line that direct to the folder that contain the data.
its called "graph.db"
replace it with the same folder from your backup of the DB that you want to clone.

Related

neo4j dump error: database does not exist

I'm new to neo4j.
I have created a new graph/database named db-learning. I'm able to connect and perform some operations on the database via neo4j browser. No issue at all.
However when I tried to dump it using neo4j-admin dump --database "db-learning" --to "/some/path" I get this error saying database not found.
Database does not exist: db-learning
Am I missing something?
Sorry if that's confusing. The database name in the project is not related to the underlying database name (which is neo4j for the default database)
So if you open the terminal, this should be good enough:
./bin/neo4j-admin dump --database "neo4j" --to "/tmp/test.dump"
I think you can also leave off the default database name.
Getting the same issue when neo4j is in fact an existing DB. I don't know how the N4J team managed to overcomplicate this so much but this whole process is such a nightmare.
The Aura service only accepts .dump files, which have to be generated via neo4j-admin. This won't allow remote DBs so you have to pull down a neo4j directory (for instance, from a graphenedb.com dump), load it locally, then export that via neo4j-admin -> dump file in order to upload and import into a Aura instance.
Has anyone at Neo4j actually used their own software?

neo4j console how to specify local path of existing db?

Suppose I have a graph database created with Neo4j Desktop in the path
path/neo4jDatabases/database-abc/installation-3.5.5
In a different path I have the neo4j-community-3.5.5 folder (I am on OSX). I am trying to start the path/neo4jDatabases/database-abc/installation-3.5.5 database with neo4j-community.
I am trying this command:
sudo ./bin/neo4j console -path path/neo4jDatabases/database-abc/installation-3.5.5
but the started database is using the directories of neo4j-community-3.5.5 instead of the ones specified in the path.
How can I start neo4j-community using the path of an existing db (created with Neo4j Desktop)?
The path argument doesn't exist for the command neo4j.
If you want to change the data folder location of your community server, you need to modify the configuration of your community server (the conf/neo4j.conf) by specifying the dbms.directories.data property :
dbms.directories.data=path/neo4jDatabases/database-abc/installation-3.5.5/data
Cheers.

Neo4j Dump: How to specify the database?

Having successfully created and populated a database with 200,000+ nodes, I would like to create a dump as a backup.
The instructions in the documentation are simple:
neo4j-admin dump --database=<database> --to=<destination-path>
But it's not clear what to use for <database>. If I use graph.db (or leave out the option) I get an error. I know the location of the database folder.
If I put the path to the database I get the following error:
unexpected error: 'database' should be a name but you seem to have specified a path
OS: Windows 10
Partial answer:
The database parameter refers to databases that are located in neo4jFolder/data/databases folder, where neo4jFolder is the folder of the unzipped install of Neo4j.
For example: I unzipped the neo4j install zip into E:\Program Files\neo4j-community-3.3.2. My database was elsewhere on the drive. So I copied the database to E:\Program Files\neo4j-community-3.3.2\data\databases\MyDatabase. Then I was able to run neo4j-admin dump --database=MyDatabase --to=backup5.dmp successfully.
I don't know if it's possible to run dump on databases that are not found under /data/databases. I also don't know how to run a dump when Neo4j is installed with the exe installer. My solution is for the zip file installation.

Neo4j csv cypher import

Im trying to import csv files from disk with cypher commands as shown in the tutorial, but Im getting "Couldn't load the external resourse at: externalResourceFailure.
Is there any "roadmap" for importing csv in windows from files?
Thank you in advance!
take alook at SyntaxException with Neo4j LOAD command
in the question, step 3, please check if you path to the file is correct on your operating system:
the syntax for accessing a local file on windows is simply "file:c:/nosql/test/unclaimed.csv" and not file:// as might be inferred from examples on ...
You have to put the files into the import directory in neo4j.
it will work if path like this "file:///C:/myfile.csv"
The Windows and Linux file systems require different file URI schemes for streaming over HTTP. Neo4j's LOAD CSV Cypher clause makes an HTTP web request to the URI of a file and not the file system path.
For more information on file URI schemes on Windows please take a look at: http://en.wikipedia.org/wiki/File_URI_scheme#Windows_2
You can also create a folder import into your neo4j installation folder and run a cipher like this
LOAD CSV WITH HEADERS FROM "file:///yourcsvfile.csv" AS row
On mac: create a folder inside the Neo4j directory. Neo4j will install in Documents (by default)
mkdir /Users//Documents/Neo4j/default.graphdb/import
Copy your file in this location
Use it like this
USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM "file:///user_list.csv" as row create (:Users {userId: row.USER_ID });

Neo4j configuration file

I've tried to run a simple example "Hello World" with Neo4j but I don't know how to modify the configuration file.
I don't know what to put as a parameter for
"GraphDatabaseService graphDB = new GraphDatabaseFactory()
.newEmbeddedDatabase(" ..... ");"
and what other modification do I have to make. Do I have to put the org.neo4j.server.database.location from the neo4j-server.properties?
But first, do I have to run the server?
Thanks!
You can either put in the path from org.neo4j.server.database.location in the neo4j-server.properties file which will allow you to access the same database referred to when you run the server/webadmin.
Or you can put in the path to any directory that you have access to and your database will be created there.
You should not run the server since the above code uses Neo4j in embedded mode.

Resources