24.1. Introducing Backup
Backups are performed over the network, from a running Neo4j server and into a
local copy of the database store (the backup). The backup is run using the
neo4j-backup tool, which is provided alongside Neo4j Enterprise.
Neo4j Server must be configured to run a backup service. This is enabled via
the configuration parameter
Performing a backup requires specifying the target host, an optional port, and the backup location. The backup tool will automatically select a full or incremental backup, based on whether an existing backup is present at that location.
# Performing a full backup: create a blank directory and run the backup tool mkdir /mnt/backup/neo4j-backup ./bin/neo4j-backup -host 192.168.1.34 -to /mnt/backup/neo4j-backup # Performing an incremental backup: just specify the location of your previous backup ./bin/neo4j-backup -host 192.168.1.34 -to /mnt/backup/neo4j-backup # Performing an incremental backup where the service is listening on a non-default port ./bin/neo4j-backup -host 192.168.1.34 -port 9999 -to /mnt/backup/neo4j-backup
An incremental backup is performed whenever an existing backup directory is specified. The backup tool will then copy any new transactions from the Neo4j server and apply them to the backup. The result will be an updated backup that is consistent with the current server state.
However, the incremental backup may fail for a number of reasons:
- If the existing directory doesn’t contain a valid backup.
- If the existing directory contains a backup of a different database store.
- If the existing directory contains a backup from a previous database version.
Note that when copying the outstanding transactions, the backup tool needs
access to the historical logical logs. These logical logs are kept by Neo4j and
automatically removed after a period of time, based on the