Backup your databases

The following steps assume that:

  • You have one or more databases hosted on Neo4j 4.4.

  • That you want to migrate those databases when upgrading to Neo4j 5.

Prepare the databases for migration

Confirm that BTREE indexes have RANGE, POINT, or TEXT equivalents

It is recommended that you create new RANGE, POINT, or TEXT indexes for each of your BTREE indexes and index-backed constraints. See the instructions in Prepare indexes.

Make your databases read-only

To ensure the databases do not get updated during the backup, put them into read-only mode using Cypher®:


Create a backup of each database

You can back up all databases from a single 4.4 cluster member.

If you are migrating databases from an installation of Neo4j 4.4 Community Edition, you will need to take the database offline and perform a backup using the neo4j-admin dump command.

If you are backing up a database from a cluster, run the Cypher command SHOW DATABASES YIELD *, and choose a server that is up-to-date with the last committed transaction on all databases as a backup source.

  1. Create a directory to store backups. These steps use /migration-backups.

  2. Run the neo4j-admin backup command to back up each of your databases. Use the option --include-metadata=all to include all roles and users associated with each of your databases.

/usr/bin/neo4j-admin backup --database=<databasename>  --backup-dir=/migration-backups --include-metadata=all

Ensure that you have successfully backed up all your databases. The result is a folder for each database, called <databasename> and located in the /migration-backups folder, and a metadata script for each database, located in migration-backups/<databasename>/tools/metadata_script.cypher.

For more information about the neo4j-admin backup command, see Operations Manual 4.4 → Back up an online database.