Migrate a version 4 instance to the latest version
This tutorial describes how to migrate an Aura instance running Neo4j 4 to the latest version of Neo4j.
|
Prepare for the upgrade
Drivers
Neo4j’s official drivers have some significant and breaking changes between versions you need to be aware of. For a smooth migration:
-
Check the breaking changes for each driver you use, for example in the Python driver and in the GDS client.
-
Make sure you switch to the latest version of the driver in line with the version of the Neo4j database. This can be done before upgrading the version of Neo4j that you are using with Aura, as Neo4j latest version drivers are backward compatible.
The Upgrade and migration guide contains all information and lists all the breaking changes.
Indexes
In Neo4j 5, BTREE indexes were replaced by RANGE, POINT, and TEXT indexes. These indexes are not automatically created during migration, so you must manually create an equivalent index for each BTREE index in Neo4j 4.
The SHOW INDEXES
command lists all database indexes.
If your database is running Neo4j 4.4 or later, you can create these new index types before migrating. Read more in the Cypher Manual > Future Indexes.
RANGE indexes can replace most BTREE indexes.
TEXT indexes are more appropriate for queries evaluating STRING
predicates involving the CONTAINS
or ENDS WITH
operators.
For more information, see the Cypher Manual → Create text indexes.
POINT indexes should be used for queries evaluating POINT
values.
For more information, see the Cypher Manual → Create point indexes.
After creating the new index, the old index should be dropped.
CREATE RANGE INDEX range_index_name FOR (n:Label) ON (n.prop1);
DROP INDEX index_name;
Propety uniqueness and key constraints are backed by indexes. For more information, see the Cypher Manual → Constraints and backing indexes.
For information about indexes and query performance, see the link: Cypher Manual → The impact of indexes on query performance.
Cypher updates
All changes to Cypher, including feature additions, deprecations, and removals, are introduced in Neo4j versions. For more information, see the Cypher Manual → Removals, deprecations, additions and extensions.
Thoroughly review this section in the version you are moving to and make the necessary changes in your code.
APOC
Aura contains most but not all functions and procedures contained in the APOC Core library. All APOC procedures and functions available in Aura are listed in the APOC Core library.
Procedures
Some procedures have been replaced by commands:
Procedure | Replacement |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- |
Refer to the Upgrade and migration guide for a full list of removals and deprecations.
Neo4j Connectors
If you are using a Neo4j Connector for Apache Spark or Apache Kafka, make sure its version is compatible with Neo4j latest version.
The Neo4j BI Connectors available on the Deployment center are compatible with Neo4j latest version.
Perform the upgrade
Once you have prepared your Neo4j 4 Aura instance, you are ready to migrate the instance to a new or existing Neo4j latest version instance.
Clone
If you have an existing Neo4j latest version instance, you can use the Clone To Existing instance action on your Neo4j 4 AuraDB instance.
If you do not have an existing Neo4j latest version instance, you can use the Clone To New instance action on your Neo4j 4 AuraDB instance.
Export and import
Alternatively, you can Export a snapshot dump file from your Neo4j 4 AuraDB instance, create a new Neo4j latest version instance manually, and then import the dump file into your new Neo4j latest version instance.