Restore a database backup

Command

A database backup or an offline database can be restored using the restore command of neo4j-admin. You must create the database (using CREATE DATABASE against the system database) after the restore operation finishes, unless you are replacing an existing database. neo4j-admin restore must be invoked as the neo4j user to ensure the appropriate file permissions.

For more information, see Administrative commands.

Syntax

neo4j-admin restore --from=<path>
                    [--verbose]
                    [--database=<database>]
                    [--force]

Options

Option Default Description

--from

Path to the database backup that is going to be restored.

--verbose

Enable verbose output.

--database

neo4j

Name for the restored database.

--force

Replace an existing database.

Example

The following is an example of how to perform an online restore of the database backup created in the section Back up an online database, using the neo4j-admin restore command.

bin/neo4j-admin restore --from=/mnt/backups/neo4j --database=neo4j --force

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

For a detailed example on how to back up and restore a database in a Causal cluster, see Back up and restore a database in Causal Cluster.