Migrate a single instance (offline)

This chapter describes the necessary steps to migrate a single instance from Neo4j version 3.5 to 4.0.

To migrate from 3.5.latest to a version beyond 4.0, the single instance must first be migrated to 4.0 and thereafter upgraded to desired version.
Pre-migration steps
Shutdown and backup
  1. If the database is running, shut it down cleanly.

  2. Perform and verify backups:

Upgrade
  1. Install Neo4j 4.0 using one of the following methods, specific to your technology:

    1. If using a tarball or zipfile for installation:

      1. Untar or unzip Neo4j 4.0.

      2. Transfer the new neo4j.conf that you prepared in the Apply configuration changes step in Prepare to migrate.

      3. Set dbms.allow_upgrade=true in neo4j.conf of the 4.0. installation. Neo4j will fail to start without this configuration.

      4. Move the files used for encryption from the old installation to the new one.

      5. Use Neo4j Admin tools, such as neo4j-admin backup (for online installation), or neo4j-admin dump (for offline installation), to move 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.

    2. If using a Debian or RPM distribution:

      1. Set dbms.allow_upgrade=true in neo4j.conf.

      2. Install Neo4j 4.0.

      3. When prompted, review the differences between the neo4j.conf files of the previous version and Neo4j 4.0.

      4. Transfer any custom settings to the 4.0 installation, as noted under the Apply configuration changes step in Prepare to migrate.

        Make sure to preserve dbms.allow_upgrade=true, as set in the instruction above.

        Neo4j will fail to start without this configuration.

  2. Start up Neo4j 4.0. The database migration will take place during startup.

    The neo4j.log file contains valuable information on how many steps the migration will involve and how far it has progressed. For large migrations, it is a good idea to monitor this log continuously.

Post-migration steps
  1. When the migration has finished, dbms.allow_upgrade=true should be set to false or be removed.

  2. Restart the database.

  3. It is good practice to make a full backup immediately after the migration.