Loading an Neo4J 3.X database in a Neo4J 4.X instance

Loading an Neo4J 3.X database in a Neo4J 4.X instance

Importing data from a Neo4J v3 database into a v4 one can be a hassle. Here are the steps to achieve the migration.

Since Neo4J V4 is a major update from V3, the data imported must be updated to the new version. Enabling the update can be done by editing the /etc/neo4j/neo4j.conf and changing the following line accordingly;

dbms.allow_upgrade=true

With that done, the data can be imported using the neo4j-admin, executed as the neo4j user

sudo -u neo4j neo4j-admin load --from=<dump_file> --database=<your db> --force

In case neo4j-admin has been executed as root, The ownership of files might need to be set back to the neo4j user.

sudo chown -R neo4j:neo4j /var/lib/neo4j/data/databases/<your db>
sudo chown -R neo4j:neo4j /var/lib/neo4j/data/transactions/<your db>