Restore a database dump

This section describes how to restore a database dump in a live Neo4j deployment.

A database dump can be loaded to a Neo4j instance using the load command of neo4j-admin.

1. Command

The neo4j-admin load command loads a database from an archive created with the neo4j-admin dump command. The command can be run from an online or an offline Neo4j DBMS. If you are replacing an existing database, you have to shut it down before running the command. If you are not replacing an existing database, you must create the database (using CREATE DATABASE against the system database) after the load operation finishes. neo4j-admin load must be invoked as the neo4j user to ensure the appropriate file permissions.

1.1. Syntax

neo4j-admin load [--verbose]
                  --from=<archive-path>
                  --database=<database>
                 [--force]
                 [--info]

1.2. Options

Option Default Description

--verbose

Enable verbose output.

--from

Path to archive created with the neo4j-admin dump command.

--database

neo4j

Name for the loaded database.

--force

Replace an existing database.

--info

Print meta-data information about the archive file, such as, file count, byte count, and format of the load file.

2. Example

The following is an example of how to load the dump of the neo4j database created in the section Back up an offline database, using the neo4j-admin load command. When replacing an existing database, you have to shut it down before running the command.

bin/neo4j-admin load --from=/dumps/neo4j/neo4j-<timestamp>.dump --database=neo4j --force

Unless you are replacing an existing database, you must create the database (using CREATE DATABASE against the system database) after the load operation finishes.

When using the load command to seed a Causal Cluster, and a previous version of the database exists, you must delete it (using DROP DATABASE) first. Alternatively, you can stop the Neo4j instance and unbind it from the cluster using neo4j-admin unbind to remove its cluster state data. If you fail to DROP or unbind before loading the dump, that database’s store files will be out of sync with its cluster state, potentially leading to logical corruptions. For more information, see Seed from backups.