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 to ensure the appropriate file permissions.
CREATE DATABASE. See Section 6.2.1, “Administrative commands” for more information.
load commands is the recommended and safe way of transferring databases between environments.
These commands are capable of discerning which files need to be exported and imported and which should not.
By contrast, file system copy-and-paste of databases is not supported.
dumpcommand of neo4j-admin
Dump the database called
neo4j into a file called
The destination directory for the dump file — in this case /backups/neo4j — must exist before calling the command.
$neo4j-home> bin/neo4j-admin dump --database=neo4j --to=/backups/neo4j/2016-10-02.dump $neo4j-home> ls /backups/neo4j $neo4j-home> 2016-10-02.dump
loadcommand of neo4j-admin
Load the backed-up database contained in the file
/backups/neo4j/2016-10-02.dump into database
If you have a database running, it needs to be shutdown first.
When we use the
--force option, any existing database gets overwritten.
$neo4j-home> bin/neo4j-admin load --from=/backups/neo4j/2016-10-02.dump --database=neo4j --force