12.7. 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]


Examples of usage


Example 12.14. Use the dump command of neo4j-admin

Dump the database called graph.db into a file called /backups/graph.db/2016-10-02.dump. 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
Example 12.15. Use the load command of neo4j-admin

Load the backed-up database contained in the file /backups/graph.db/2016-10-02.dump into database graph.db. 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

If using the load command to seed a Causal Cluster, you must first perform neo4j-admin unbind on each of the cluster instances. The procedure is described in Section 5.3.3, “Seed from an offline backup”.