neo4j DatabaseNotFoundError, with status "offline" - neo4j

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.

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?

How to make Neo4J Enterprise backup work?

I'm trying to remotely back up my Neo4J database for already 2 days and nothing works.
I run
sudo neo4j-admin backup --backup-dir=backup --name=graph.db-backup --from=1.1.1.1:1111 --timeout=50m
The files start to get saved and then simply erased after a while and there's no backup.
I tried setting up --pagecache=16M and HEAP_SIZE but it has no effect. Sometime it just stalls sometimes I get an error like this:
unexpected error: java.io.IOException: org.neo4j.com.ComException: Channel has been closed
The DB I'm backing up is Enterprise 3.3.3 and the one I'm backing up with is 3.5.14
Thank you for any help.
Is this the normal Neo4J behavior?

Neo4j-admin dump is failing

I'm trying to dump a database on Neo4j Desktop 3.5.0 with:
...\bin> neo4j-admin dump --database=graph.db --to=/backup/db1.dump
And getting
command failed: Active logical log detected, this might be a source of inconsistencies.
Please recover database before running the dump.
To perform recovery please start database and perform clean shutdown.
The documentation states that "neo4j-admin must be invoked as the neo4j user in order to ensure the appropriate file permissions.". Might that be the problem?
If so, how to "invoke as the neo4j user"?
found workaround.
shutdown database
open terminal
run bin/neo4j console
after startup, hit Ctrl+C to shutdown database
then, run neo4j-admin dump respectivery
confirmed on Neo4j Desktop 1.1.15
This may be a known issue in version 3.5.0.
I had the same problem on Neo4j 4.1, what worked for me was to simply:
Stop the database
Start the database
Stop it again
After which neo4j-admin dump worked.
Credit for the solution to #folterj's last answer on this thread.
For me I was using different neo4j versions for creating (4.4.0) and dumping (4.2.6) the database

Neo4j 2.3.1 not releasing handles on import files

After upgrading from Neo4j 2.2.5 to Neo4j 2.3.1 on Windows Server 2012 R2 with Java 8.45, we encountered a problem with file handles. When running the command shown at the bottom of this post using either the web interface or neo4jshell.bat, the cypher completes successfully and a process monitor trace confirms that Java successfully closed the file. However, I am unable to move that csv file because the file is open in another process. Handle.exe confirms that Java still has a read-write handle on that file.
When I run the same process against a Neo4j 2.2.5 graph on the same machine with the same file, Java does not retain the read-write handle on the csv file. We will need to revert to 2.2.5 until this issue is resolved. The only application change we made during the upgrade from 2.2.5 to 2.3.1 was to accommodate the new file reference format (file:///x://filename.csv vs. file:x:/filename.csv).
Are there other actions we can take short of restarting the service or stopping and starting the drive to force Java to close this file? I understand that Neo4jShell.bat is deprecated in favor of the powershell commands, but ultimately the issue is that Java is retaining the file handle, so changing the method of delivering the cypher command can't improve the way Java is handling the csv file. I've run the same cypher from both the web interface and neoj4shell.bat and gotten the same result.
USING PERIODIC COMMIT 3000
LOAD CSV WITH HEADERS
FROM "file:///x://filename.csv"
AS line
MATCH (a:node {id : line.id}), (b:othernode {id : line.other_id})
WITH a, b
WHERE shortestPath((a)-[:PREVIOUS]->(b)) is null
CREATE (a)-[:PREVIOUS]->(b);

neo4j update old graph.db not cleanly shutdown

I am receiving a "not cleanly shutdown" log message when attempting to open a 2 year old Neo4j database posted on github at https://github.com/IGS/disease-ontology/tree/master/database/neo4j. How do I open/update this database?
Here's how I got it initialized: Downloaded the graph_db.tgz to my local win7-64 machine (neo4j-community-1.9.RC2), extracted the graph.db file to the data subfolder, renamed it graph_ontology.db, and edited the server config file to point to it as follows:
org.neo4j.server.database.location=data/graph_ontology.db
When starting Neo4j, the last entry in the log file is:
2013-05-21 17:23:33.418+0000 INFO [o.n.k.EmbeddedGraphDatabase]: Startup failed: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager#1f91d41b' was successfully initialized, but failed to start. Please see attached cause exception.: Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#b86527e' was successfully initialized, but failed to start. Please see attached cause exception.: Mismatching store version found (Uknown while expecting v0.A.0) and the store is not cleanly shutdown. Recover the database with the previous database version and then attempt to upgrade
Thanks,
Jeff
Look at the messages.log of the database to determine which neo4j version it was started with last.
In this case it is 1.4
You can get it from here: http://dist.neo4j.org/neo4j-community-1.4.2-windows.zip
You can easily just point the neo4j-shell to it:
create an upgrade.properties that contains: allow_store_upgrade=true
and then use: bin/neo4j-shell -path graph_ontology.db -config upgrade.properties
Here is the converted db for 1.9.GA: https://dl.dropboxusercontent.com/u/14493611/disease_ontology_graphdb-1.9.tgz

Resources