25.5. Upgrade of a Neo4j HA Cluster

Upgrading a Neo4j HA cluster to Neo4j 3.1.0-SNAPSHOT requires following a specific process in order to ensure that the cluster remains consistent, and that all cluster instances are able to join and participate in the cluster following their upgrade. Neo4j 3.1.0-SNAPSHOT does not support rolling upgrades.

Back up the Neo4j database

  • Before starting any upgrade procedure, it is very important to make a full backup of your database.
  • For detailed instructions on backing up your Neo4j database, refer to the backup guide.

Shut down the cluster

  • Shut down the database slave instances one by one.
  • Shut down the master last.

Upgrade the master

  1. Install Neo4j 3.1.0-SNAPSHOT on the master, keeping the database files untouched.
  2. Disable HA in the configuration, by setting dbms.mode=SINGLE in neo4j.conf.
  3. Upgrade as described for a single instance of Neo4j
  4. When upgrade has finished, shut down Neo4j again.
  5. Re-enable HA in the configuration by setting dbms.mode=HA in neo4j.conf.
  6. Make a full backup of the Neo4j database. Please note that backups from before the upgrade are no longer valid for update via the incremental online backup. Therefore it is important to perform a full backup, using an empty target directory, at this point.

Upgrade the slaves

On each slave:

  1. Remove all database files.
  2. Install Neo4j 3.1.0-SNAPSHOT.
  3. Review the settings in the configuration files in the previous installation, and transfer any custom settings to the 3.1.0-SNAPSHOT installation. Be aware of settings that have changed name between versions.
  4. If the database is not called graph.db, set dbms.active_database in neo4j.conf to the name of the database.
  5. If applicable, copy security the security configuration from the master, since this is not propagated automatically. See the section called “Copying security configuration from one instance to another” for instructions.
[Tip]Tip

At this point it is an alternative is to manually copy database files from the master to the slaves. Doing so will avoid the need to sync from the master when starting. This can save considerable time when upgrading large databases.

Restart the cluster

  1. Start the master instance.
  2. Start the slaves, one by one. Once a slave has joined the cluster, it will sync the database from the master instance.