neo4j-backup — Neo4j Backup Tool
neo4j-backup -from SourceURI -to Directory
A tool to perform live backups over the network from a running Neo4j graph database onto a local filesystem. Backups can be either full or incremental. The first backup must be a full backup, after that incremental backups can be performed.
The source(s) are given as URIs in a special format, the target is a filesystem location.
- copies the entire database to a directory.
- copies the changes that have taken place since the last full or incremental backup to an existing backup store.
The backup tool will automatically detect whether it needs to do a full or an incremental backup.
Backup sources are given in the following format:
Note that multiple hosts can be defined.
- running mode
- 'single' or 'ha'. 'ha' is for instances in High Availability mode, 'single' is for standalone databases.
- In single mode, the host of a source database; in ha mode, the cluster address of a cluster member. Note that multiple hosts can be given when using High Availability mode.
In single mode, the port of a source database backup service; in ha mode, the port of a cluster instance. If not given, the default value
6362will be used for single mode,
Backups can only be performed on databases which have the configuration parameter
That will make the backup service available on the default port (
To enable the backup service on a different port use for example
Usage - Windows
Neo4jBackup.bat script is used in the same way.
# Performing a backup the first time: create a blank directory and run the backup tool mkdir /mnt/backup/neo4j-backup neo4j-backup -from single://192.168.1.34 -to /mnt/backup/neo4j-backup # Subsequent backups using the same _target_-directory will be incremental and therefore quick neo4j-backup -from single://freja -to /mnt/backup/neo4j-backup # Performing a backup where the service is registered on a custom port neo4j-backup -from single://freja:9999 -to /mnt/backup/neo4j-backup # Performing a backup from HA cluster, specifying only one cluster member ./neo4j-backup -from ha://oden:5002 -to /mnt/backup/neo4j-backup # Performing a backup from HA cluster, specifying two cluster members ./neo4j-backup -from ha://oden:5001,loke:5002 -to /mnt/backup/neo4j-backup
RESTORE FROM BACKUP
The Neo4j backups are fully functional databases. To use a backup, replace your database directory with the backup.