Dump and load databases
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]
The database must be stopped before running the
neo4j-adminmust be invoked as the
neo4juser to ensure the appropriate file permissions.
If the database used to load into doesn’t exist prior to loading, it must be created subsequently using
CREATE DATABASE. See 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
Note that if using the load command to seed a Causal Cluster, you may need to first drop pre-existing databases or perform
neo4j-admin unbind on each of the cluster instances.
The procedure is described in Seed from backups.
When loading database dumps, if a previous version of the database already exists, you must drop it (using
DROP DATABASE) first.
Alternatively, you can stop the Neo4j instance and unbind it from the cluster using
If you fail to
unbind before loading the dump, that database’s store files will be out of sync with its cluster state, potentially leading to logical corruptions
Was this page helpful?