Database Reference
In-Depth Information
It's important to ensure that Neo4j shuts down cleanly whenever your application exits;
failuretodosocouldresultinproblemsthenexttimeyoustartup.Youdon'tneedtoworry
about a clean shutdown when using Neo4j server—this will be done for you.
Copy the physical database files
Locate the directory that contains the physical Neo4j database files. For applications that
runinembeddedmode,thiswillbethepathyousupplyinthestartupcode.Torefreshyour
memory, the following snippet shows the code required to start up an embedded database
where the physical files reside in the directory /var/data/neo4jdb:
private GraphDatabaseService graphdb =
new GraphDatabaseFactory().newEmbeddedDatabase("/var/data/neo4jdb" )
If you're working with the server mode, the database files will be located at the location
specified by the org.neo4j.server.database.location key in the neo4j-serv-
er.properties file. That setting will look something like the following:
org.neo4j.server.database.location=/var/data/neo4jdb
Copy the directory and all subfolders and files to a separate backup location.
Restart the database
For Neo4j server, use the appropriate Neo4j start command, and for embedded applica-
tions, restart the application as appropriate.
Note
Neo4j is able to detect unclean shutdowns and attempt a recovery, but this will result in a
slower initial startup while the recovery is in process, and it sometimes may result in oth-
er issues as well. When an unclean shutdown occurs, the following warning message can
generally be seen in the logs the next time the database is started up again— non clean
shutdown detected . You should verify that your shut down processes, both graceful
and forced, do their best to ensure Neo4j is shutdown cleanly.
Search WWH ::




Custom Search