neo4j dump error: database does not exist - neo4j

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?

Related

Redis bulk action restore RDB - RDB Path issue

I'm new to Redis Cache and I just created a local database in which I'm trying to restore an export from a RDB file.
I'm using Redis Insight as a client, running via docker, with volumes.
I identified the bulk_operation folder, copied the .rdb file in there and now from the Redis Insight interface I'm trying to restore the RDB using bulk actions.
However the path I'm providing results in "File not found" and I can't get to the expected format.
./db/bulk_operation/export-7b85c642-3bfc-4904-b0c0-81c84aae6748.rdb
The /DB is mounted to my local persistence folder.
Any advice is appreciated.
My trial wasn't far from the truth, the expected format was /db/bulk_operation/export-7b85c642-3bfc-4904-b0c0-81c84aae6748.rdb - note the missing dot at the beginning.
The fact that RedisInsight also randomly gives errors did not help, on the first two tries it failed, then randomly it worked.
So don't give up on the first fail :)

neo4j DatabaseNotFoundError, with status "offline"

I had a neo4j database on my personal computer(window 10). When I try to migrate this database to the server(centos7).
I use script like this to export the database:
neo4j-admin dump --database=neo4j --to=<someplace>/neo4j.dump
I copy the dump file to server, and try to import it to neo4j on my server:
neo4j-admin load --from=/var/lib/neo4j/data/dumps/neo4j.dump --database=neo4j --force
When I start neo4j, and enter the neo4j browser, it says that
DatabaseNotFoundError
Database "neo4j" is unavailable, its status is "offline".
The version of neo4j on my computer and server are both 4.4.3.
How can I restore my database?
In the web console select the system db and run the query show databases
It will show if there are any errors
Then check the debug.log of neo4j for the reason
In my case the issue was, I had used the root user load the dump. I had to manually change file permissions
I had a similar problem and had to first drop the database DROP DATABASE neo4j then create a new database CREATE DATABASE neo4j.
You're describing an issue where the browser lost connection to the database (since you stopped the database in order to reload from file). To connect anew, close the browser and open a new window (example: http://localhost:7474/browser/); this should prompt you to connect again. It is possible to reconnect an old browser window after database shutdown+start, but close+open is easier to explain.
Also, to confirm your other steps, they look fine for taking the dump and loading it. The following works for me with neo4j Community 4.4.5:
first, stop the database:
% ./bin/neo4j stop
Stopping Neo4j....... stopped.
run dump, saving to a new file named "export.dat":
% ./bin/neo4j-admin dump --database=neo4j --to=export.dat
Selecting JVM - Version:11.0.14+8-LTS-263, Name:Java HotSpot(TM) 64-Bit Server VM, Vendor:Oracle Corporation
Done: 40 files, 334.5MiB processed.
run load to put "export.dat" back to the same "neo4j" database:
% ./bin/neo4j-admin load --from=export.dat --database=neo4j --force
Selecting JVM - Version:11.0.14+8-LTS-263, Name:Java HotSpot(TM) 64-Bit Server VM, Vendor:Oracle Corporation
Done: 40 files, 334.5MiB processed.
start the database again:
% ./bin/neo4j start
Directories in use:
[...]
Starting Neo4j.
Started neo4j (pid:3852). It is available at http://localhost:7474
There may be a short delay until the server is ready.

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.

Copying a local database from one computer to another ne04j

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.

Resources