This section describes the dump and load commands of Neo4j Admin.
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]
neo4j-adminmust be invoked as the
neo4juser in order to ensure the appropriate file permissions.
Examples of usage
Moving databases from one environment to another.
load commands is the recommended, and safe, way of transferring databases between environments.
They understand which files need to be exported and imported and which should not.
By contrast, file system copy-and-paste of databases is not supported.
For a discussion of online versus offline backups, see Section 7.1.2, “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