Backup modes

The backup client can operate in two different modes – a full backup and an incremental backup.

Full backup

A full backup is always required initially for the very first backup into a target location.

The full backup can be run against both an online (using neo4j-admin backup) and an offline (using neo4j-admin dump) database.

Example 1. Full backup against an online database
$neo4j-home> export HEAP_SIZE=2G
$neo4j-home> mkdir /mnt/backups
$neo4j-home> bin/neo4j-admin backup --from=192.168.1.34 --backup-dir=/mnt/backups/neo4j --database=neo4j --pagecache=4G
Doing full backup...
2017-02-01 14:09:09.510+0000 INFO  [o.n.c.s.StoreCopyClient] Copying neostore.nodestore.db.labels
2017-02-01 14:09:09.537+0000 INFO  [o.n.c.s.StoreCopyClient] Copied neostore.nodestore.db.labels 8.00 kB
2017-02-01 14:09:09.538+0000 INFO  [o.n.c.s.StoreCopyClient] Copying neostore.nodestore.db
2017-02-01 14:09:09.540+0000 INFO  [o.n.c.s.StoreCopyClient] Copied neostore.nodestore.db 16.00 kB
...
...
...

For more information about online backup options and how to control memory usage, see Back up an online database.

For more information about performing a full backup against an offline database, see Back up an offline database.

Incremental backup

After the initial full backup, the subsequent backups attempt to use the incremental mode, where just the delta of the transaction logs since the last backup is transferred and applied to the target location. If the required transaction logs are not available on the backup server, then the backup client falls back on performing a full backup instead, unless --fallback-to-full is disabled. The incremental backup can be run only against an online database.

The incremental backup strategy is configured by the dbms.backup.incremental.strategy setting.

The default strategy is UNBOUNDED, meaning that the server will send transactions until all committed transactions have been sent, even those committed after the start of the backup job. This strategy is suitable for a low ingest rate environment, where the backup network throughput is high enough to keep up with the transaction rate. For the UNBOUNDED strategy to be effective, the backup and database files must be on the same filesystem for the backup to catch up with as few transactions as possible.

In an environment with a high ingest rate and a low backup network throughput, it is advisable to use the START_TIME strategy, which sends only the transactions committed before the start of the backup job. Otherwise, the backup might hang for a long time, trying to catch up as transactions continue to checkpoint and then be committed to the database.

Example 2. Incremental backup against an online database
$neo4j-home> export HEAP_SIZE=2G
$neo4j-home> bin/neo4j-admin backup --from=192.168.1.34 --backup-dir=/mnt/backups/neo4j --database=neo4j --pagecache=4G
Destination is not empty, doing incremental backup...
Backup complete.

For more information about online backup options and how to control memory usage, see Back up an online database.