Backup modes

The backup client can operate in two different modes – a full backup and a differential 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 an online (using the Enterprise edition command — neo4j-admin database backup) and an offline (using neo4j-admin database dump) database.

neo4j-admin database backup

Example 1. Backing up an online database
export HEAP_SIZE=2G
mkdir /mnt/backups
bin/neo4j-admin database backup --from=192.168.1.34 --to-path=/mnt/backups/neo4j --pagecache=4G neo4j
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
...
...
...

The neo4j-admin database backup command with the --type=full argument creates a full backup artifact file in the format of <databasename><timestamp>.backup, in the target location specified by --to-path.

The neo4j-admin database backup command allows you to include metadata, enabling the backup to store the role-based access control (RBAC) metadata associated with the database.

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

neo4j-admin database dump

The neo4j-admin database dump command creates a single-file archive that follows the format <databasename><timestamp>.dump, and stores it in the <NEO4J_HOME>/data directory unless specified by --to-path=<path>.

When using neo4j-admin database dump, only the database data is backed up. The associated users and roles metadata are not included and must be recreated manually after restore. See Authentication and authorization for details.

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

Differential backup

In the online backup version, after the initial full backup, subsequent backups attempt to use differential mode, where only the delta of the transaction logs since the last backup is transferred and used to create a differential backup artifact (stored in the target location). Those differential backup artifacts form a backup chain. If the required transaction logs are not available on the backup server, then the backup client falls back on performing a full backup instead.

Example 2. Differential backup against an online database
export HEAP_SIZE=2G
bin/neo4j-admin database backup --from=192.168.1.34 --to-path=/mnt/backups/neo4j --pagecache=4G neo4j
Destination is not empty, doing differential backup...
Backup complete.