9.3. Restore a backup

This section describes how to restore from backups of a Neo4j deployment.

This section includes:

9.3.1. Restore command

A Neo4j database can be restored using the restore command of neo4j-admin.

Restoring a database does not configure it as being created in the Neo4j DBMS. That configuration lives in the system database and if a backup of the system database is restored, then any configuration for other databases in it will also be restored. If the restored database has not been created yet, use the CREATE DATABASE command after restoring, to create it. See Section 5.2.1, “Administrative commands” for more information.

Syntax

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

Options

Option Default Description

--from

 

Path to backup to restore from.

--database

neo4j

Name of database.

--force

 

If an existing database should be replaced.

9.3.2. Restore a standalone server

To restore from backups, follow these steps:

  1. If the server is running, shut it down.
  2. Run neo4j-admin restore for every database.
  3. Start up the server.
Example 9.3. Restore a standalone server

Restore the databases system and neo4j from the backups located in /mnt/backups. Note that the server must be shut down.

neo4j-home> bin/neo4j stop
neo4j-home> bin/neo4j-admin restore --from=/mnt/backups/system --database=system --force
neo4j-home> bin/neo4j-admin restore --from=/mnt/backups/neo4j --database=neo4j --force
neo4j-home> bin/neo4j start

9.3.3. Restore a cluster

To restore a Causal Cluster from backups, follow these steps:

  1. Shut down all server instances in the cluster.
  2. Run the neo4j-admin unbind command on each of the Core Servers.
  3. Restore the backups on each instance, using neo4j-admin restore.
  4. If you are restoring onto new hardware, please review the Causal Clustering settings in neo4j.conf.

    In particular, check the settings causal_clustering.initial_discovery_members, causal_clustering.minimum_core_cluster_size_at_formation, and causal_clustering.minimum_core_cluster_size_at_runtime, and ensure that they correctly reflect the new setup.

  5. Start the server instances.

Refer to Seed a cluster for more detailed information.