Chapter 27. Backup

Table of Contents

27.1. Embedded and Server
27.2. Online Backup from Java
27.3. High Availability
27.4. Restoring Your Data
[Note]Note

The Backup features are only available in the Neo4j Enterprise Edition.

Backups are performed over the network live from a running graph database onto a local copy. There are two types of backup: full and incremental.

A full backup copies the database files without acquiring any locks, allowing for continued operations on the target instance. This of course means that while copying, transactions will continue and the store will change. For this reason, the transaction that was running when the backup operation started is noted and, when the copy operation completes, all transactions from the latter down to the one happening at the end of the copy are replayed on the backup files. This ensures that the backed up data represent a consistent and up-to-date snapshot of the database storage.

In contrast, an incremental backup does not copy store files — instead it copies the logs of the transactions that have taken place since the last full or incremental backup which are then replayed over an existing backup store. This makes incremental backups far more efficient than doing full backups every time but they also require that a full backup has taken place before they are executed.

The backup tool will detect whether you are trying to run a full backup or an incremental one by inspecting the target directory. Regardless of the mode a backup is created with, the resulting files represent a consistent database snapshot and they can be used to boot up a Neo4j instance.

The database to be backed up is specified using a URI with syntax

<running mode>://<host>[:port]{,<host>[:port]*}

Running mode must be defined and is either single for non-HA or ha for HA clusters. The <host>[:port] part points to a host running the database, on port port if not the default. The additional host:port arguments are useful for passing multiple cluster members.

[Important]Important

As of version 1.9, backups are enabled by default. That means that the configuration parameter online_backup_enabled defaults to true and that makes the backup service available on the default port (6362). To enable the backup service on a different port use online_backup_server=:9999.

Asking questions

Here's where to ask to get the best answers to your Neo4j questions:

  • Having trouble running an example from the manual? First make sure that you're using the same version of Neo4j as the manual was built for! There's a dropdown on all pages that lets you switch to a different version.
  • Something doesn't work as expected with Neo4j? The stackoverflow.com neo4j tag is an excellent place for this!
  • Found a bug? Then please report and track it using the GitHub Neo4j Issues page. Note however, that you can report documentation bugs using the Disqus thread below as well.
  • Have a data modeling question or want to participate in discussions around Neo4j and graphs? The Neo4j Google Group is a great place for this.
  • Is 140 characters enough for your question? Then obviously Twitter is an option. There's lots of #neo4j activity there.
  • Have a question on the content of this page or missing something here? Then you're all set, use the discussion thread below. Please post any comments or suggestions regarding the documentation right here!