This section describes the dump and load commands of Neo4j Admin.
A Neo4j database can be dumped and loaded using the
load commands of
neo4j-admin dump --database=<database> --to=<destination-path>
neo4j-admin load --from=<archive-path> --database=<database> [--force]
These commands can be useful for moving databases from one environment to another. They can also be used for offline backups of the database. For a discussion of online versus offline backups, see Section 6.1.1, “Online and offline backups”.
dumpcommand of neo4j-admin
Dump the database called
graph.db into a file called
The destination directory for the dump file — in this case /backups/graph.db — must exist before calling the command.
$neo4j-home> bin/neo4j-admin dump --database=graph.db --to=/backups/graph.db/2016-10-02.dump $neo4j-home> ls /backups/graph.db $neo4j-home> 2016-10-02.dump
loadcommand of neo4j-admin
Load the backed-up database contained in the file
/backups/graph.db/2016-10-02.dump into database
Since we have a database running, we first have to shut it down.
When we use the
--force option, any existing database gets overwritten.
$neo4j-home> bin/neo4j stop Stopping Neo4j.. stopped $neo4j-home> bin/neo4j-admin load --from=/backups/graph.db/2016-10-02.dump --database=graph.db --force
Expert users of Neo4j have become aware of the historical format and content of the database directory. Short cuts like copy-and-pasting that directory have been used to transfer and seed databases conveniently. However the form and content of the database directory may change over time and naive copy-and-paste of files is not guaranteed to work and may be harmful.
By contrast the