Upgrade a Causal ClusterEnterprise Edition
This section describes the following:
Important pre-upgrade information
All upgrades should be approached with careful planning and testing.
- Pre-upgrade steps
-
-
Read Upgrade planning thoroughly and perform all the steps listed there.
-
Perform and verify backups:
-
Back up neo4j.conf.
-
If using native user and role management, back up the data/dbms directory.
-
Back up all the files used for encryption, i.e. private key, public certificate, and the contents of the trusted and revoked directories. The locations of these are described in SSL framework. You should back up these files on each server in the cluster.
-
Verify that you have a full backup that is stored in a safe location.
-
-
Prepare a new neo4j.conf file for each of the servers in the cluster, following the instructions under the Apply configuration changes step in Upgrade planning.
If following instructions for Rolling upgrade for replaceable resources, all the servers that form the cluster will be replaced. Therefore, make sure that the parameter
causal_clustering.initial_discovery_members
is updated to reflect the new Core members. -
If using custom plugins, make sure that you have the plugins that are adjusted for the new version in an accessible location.
-
- Limitations
-
-
Neo4j does not support downgrades. If the upgrade is not successful, you have to do a full rollback, including restoring a pre-upgrade backup.
-
In order to minimize risk, it is recommended that while upgrading, you do not change configuration, perform architectural restructuring, or similar tasks.
-
- Monitoring the status of cluster members
-
Use the procedure
dbms.cluster.overview()
to monitor the status of the cluster members during the upgrade. - Upgrade methods
-
The following are methods of upgrading a Neo4j Causal Cluster:
-
Rolling upgrade; this method is available under certain conditions.
-
Offline upgrade; this method is always available.
-
- Installing the new Neo4j version
-
For instructions on how to install the software package itself, refer to Installation.
- Post-upgrade
-
Note that backups taken 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, immediately after the upgrade.
Rolling upgrade
- Limitations
-
Rolling upgrades are only supported between patch releases, and only when a store format upgrade is not needed. Read the Data Store Changes page to find out whether a certain upgrade path involves a store format change. You can also contact Customer Support to obtain this information.
If you cannot use rolling upgrades, then follow the instructions for offline upgrades instead.
- Downtime
-
Since downgrades are not supported, a failed upgrade will require recovery from a pre-upgrade backup. Therefore, the safest path is to disable write loads during the upgrade process.
- Recommendations
-
-
When upgrading a cluster, it is important to do so in a systematic, predictable way. The critical point during the upgrades is knowing when to switch off the original members. It is recommended that you use the status endpoint when performing a rolling upgrade, which provides access to information that can aid you when deciding which member to switch off, and when it is safe to do so. For more information, see Status endpoint.
It is only possible to use the status endpoint when upgrading from Neo4j v3.5, since that is when the status endpoint was introduced.
-
Since replacing cores is no different from temporarily removing cores, the process of doing a rolling upgrade reduces fault tolerance temporarily. If you absolutely need to maintain a minimum threshold of fault tolerance, then you should increase the cluster size to account for this planned failure.
-
Rolling upgrade for fixed servers
This variant is suitable for deployments where the servers are fixed and have to be updated in-place.
- Upgrade steps
-
-
On one of the Core Servers:
-
(Optional/Recommended) Use the status endpoint to evaluate whether it is safe to remove this member.
-
Shutdown the instance.
-
Install Neo4j using one of the following methods, specific to your technology:
-
If using a tarball or zipfile for installation:
-
Untar or unzip the version of Neo4j that you want to upgrade to.
-
Place the neo4j.conf file, that you have prepared for this server, into the Configuration directory.
-
If using native user and role management, copy the data/dbms directory into the new location.
-
Copy the files used for encryption from the old installation to the new one.
-
Copy the data directory from the old installation to the new one. This step is not applicable if you have
dbms.directories.data
pointing to a directory outside of NEO4J_HOME. -
If using custom plugins, place the plugins that are adjusted for the new version in the /plugins directory.
-
-
If using a Debian or RPM distribution:
-
Install the version of Neo4j that you want to upgrade to.
-
When prompted, review the differences between the neo4j.conf files of the previous version and the new version of Neo4j. Transfer any custom settings to the new installation, as prepared in the pre-upgrade step.
-
If using custom plugins, place the plugins that are adjusted for the new version in the /plugins directory.
-
-
-
Start up Neo4j, and see it join the cluster.
-
-
Repeat the previous steps for every server instance.
-
Rolling upgrade for replaceable resources
This variant is suitable for deployments utilizing replaceable cloud or container resources. With this method, it is possible to avoid a reduction in availability, since you are adding a new instance before removing an old instance.
- Upgrade steps
-
-
Configure a new instance with the version of Neo4j that you want to upgrade to.
-
Use the new neo4j.conf that you have prepared in the pre-upgrade step.
-
If using native user and role management, place the backed-up data/dbms directory into the data directory of the new instance.
-
Copy the files used for encryption from the old installation to the new one.
-
If using custom plugins, place the plugins that are adjusted for the new version in the /plugins directory on the new instance.
-
Start up the new instance, and let it complete a store copy.
-
See the new instance join the cluster.
-
(Optional/Recommended) Use the status endpoint to evaluate whether it is safe to remove an old member.
-
Shutdown the old instance.
-
Repeat the previous steps for every server instance.
-
Offline upgrade
This variant is suitable for cases where a rolling upgrade is not possible due to breaking changes, or could be undesirable for other reasons.
- Downtime
-
If the offline upgrade method is selected, this will involve downtime. A test upgrade on a production-like equipment provides information on the duration of the downtime.
- Upgrade steps
-
-
Shut down all the servers in the cluster
-
On one of the Core Servers:
-
Set
dbms.mode=SINGLE
in neo4j.conf. -
Install Neo4j using one of the following methods, specific to your technology:
-
If using a tarball or zipfile for installation:
-
Untar or unzip the version of Neo4j that you want to upgrade to.
-
Place the neo4j.conf file, that you have prepared for this server, into the Configuration directory.
-
Set
dbms.allow_upgrade=true
in neo4j.conf. Neo4j will fail to start without this configuration. -
If using native user and role management, place the backed-up data/dbms directory into the data directory of the new instance.
-
Copy the files used for encryption from the old installation to the new one.
-
Copy the data directory from the old installation to the new one. This step is not applicable if you have
dbms.directories.data
pointing to a directory outside of NEO4J_HOME. -
If using custom plugins, place the plugins that are adjusted for the new version in the /plugins directory.
-
-
If using a Debian or RPM distribution:
-
Set
dbms.allow_upgrade=true
in neo4j.conf. -
Install the version of Neo4j that you want to upgrade to.
-
When prompted, review the differences between the neo4j.conf files of the previous version and the new version of Neo4j. Transfer any custom settings to the new installation, as prepared in the pre-upgrade step. Make sure to preserve
dbms.allow_upgrade=true
as set in the instruction above. Neo4j will fail to start without this configuration. -
If using custom plugins, place the plugins that are adjusted for the new version in the /plugins directory.
-
-
-
Start up Neo4j. The database upgrade will take place during startup.
The neo4j.log file contains valuable information on how many steps the upgrade will involve and how far it has progressed. For large upgrades, it is a good idea to monitor this log continuously.
-
Stop your Neo4j database once again.
-
Set
dbms.allow_upgrade=false
, or remove it. -
Set
dbms.mode=CORE
in neo4j.conf to re-enable Causal Clustering in the configuration. -
Use
neo4j-admin dump
to make a copy of the database. -
Do not yet restart the database.
-
-
On each of the other Core Servers:
-
Delete the database directory (in a default configuration: data/databases/graph.db).
-
Install the version of Neo4j that you want to upgrade to.
-
Transfer any custom settings to the new installation, as prepared in the pre-upgrade step.
-
If using a tarball or zipfile for installation:
-
If using native user and role management, place the backed-up data/dbms directory into the data directory of the new instance.
-
Copy the files used for encryption from the old installation to the new one.
-
-
If using custom plugins, place the plugins that are adjusted for the new version in the /plugins directory.
-
Perform
neo4j-admin unbind
on the instance. -
Using
neo4j-admin load
, restore the upgraded database onto this server.
-
-
Startup all the Core Servers and see the cluster form.
-
On each of the Read Replica servers:
-
Stop Neo4j.
-
Delete the database directory (in a default configuration: data/databases/graph.db).
-
Install the version of Neo4j that you want to upgrade to.
-
Transfer any custom settings to the new installation, as prepared in the pre-upgrade step.
-
If using a tarball or zipfile for installation:
-
If using native user and role management, place the backed-up data/dbms directory into the data directory of the new instance.
-
Copy the files used for encryption from the old installation to the new one.
-
-
If using custom plugins, place the plugins that are adjusted for the new version in the /plugins directory.
-
Using
neo4j-admin dump/load
, restore the upgraded database onto this server. Alternatively, you can omit this step and let the Read Replica do a complete store copy. -
Start the Read Replica and see it join the cluster.
-
-