Migration Guide
APOC v.5 upgrade and migration
For information on how to migrate your Neo4j database, see the Neo4j Migration Guide.
Migrate databases from Neo4j v.4.4
Databases can only be migrated to Neo4j v.5 from Neo4j v.4.4.
As of Neo4j version 5, APOC has been split into two separate repositories:
-
APOC Core Library - officially supported by Neo4j.
-
APOC Extended - a community-managed repository not officially managed by Neo4j.
The APOC Full package (APOC Core + APOC Extended) is no longer available. To use non-supported APOC Extended procedures and functions, refer to the APOC Extended repository.
APOC Configuration
As of APOC v.5, the neo4j.conf
no longer supports apoc.* configuration settings.
All configuration settings should be put inside apoc.conf
.
They can also be set using environment variables.
If the config settings are in the |
APOC Triggers
The migration of Neo4j from v.4.4 to v.5 requires the restoration of a backup.
As APOC Triggers are stored on the system
database, they are not included in the backup, and will therefore not be migrated over
with the rest of your data.
It is, therefore, necessary to recreate all your triggers using the apoc.trigger.install
procedure and
adjusting apoc.trigger.stop
as required.
For example, in a Neo4j v.4.4 database that already has existing APOC Triggers installed, the following query can be run (routed against the neo4j
database):
CALL apoc.trigger.list();
name | query | selector | params | installed | paused |
---|---|---|---|---|---|
"count-removals" |
{"phase":"after"} |
{time: 1674218712858} |
TRUE |
FALSE |
|
"count-relationships" |
{} |
{} |
TRUE |
TRUE |
The above triggers can be recreated on a Neo4j v.5 database (routed against a system LEADER
database) by doing the following:
CALL apoc.trigger.install(
'neo4j',
'count-removals',
"MATCH (c:NodesCounter) SET c.count = c.count + size([f IN $deletedNodes WHERE id(f) > 0] SET time = $time)",
{phase: 'after'},
{params: {time: 1674218712858}}
);
CALL apoc.trigger.install(
'neo4j',
'count-relationships',
"MATCH (c:RelationshipsCounter) SET c.count = c.count + size([f IN $createdRelationships WHERE id(f) > 0])",
{}
);
CALL apoc.trigger.stop('neo4j', 'count-relationships')
The APOC Triggers are now migrated to your new Neo4j v5 database.