Migrate the Neo4j configuration file

You can use the migrate-configuration command to migrate a legacy Neo4j configuration file to the current format. The new version will be written in a target configuration directory. The default location for both the source and target configuration directory is the configuration directory specified by NEO_CONF or the default configuration directory for this installation. Starting with Neo4j 2025.01, the root location of the configuration directory is server.directories.configuration=conf. If the source and target directories are the same, the original configuration files will be renamed. A configuration provided using --additional-config option will not be migrated.

Why use the command?
  • Configuration migration is a purely mechanical process, and using the explicit migration with the migrate-configuration command allows you to inspect and customize the output.

  • The command output provides valuable insight into the migration process, including notification about settings that could not have been meaningfully migrated, for instance, because the concept or behavior no longer exists in the new MAJOR version of the DBMS.

Syntax

The neo4j-admin server migrate-configuration command has the following syntax:

neo4j-admin server migrate-configuration [-h] [--expand-commands]
                                         [--verbose] [--from-path=<path>]
                                         [--to-path=<path>]

Options

The neo4j-admin server migrate-configuration command has the following options:

Table 1. neo4j-admin server migrate-configuration options
Option Description

--expand-commands

Allow command expansion in config value evaluation.

--from-path=<path>

Path to the configuration directory used as a source for the migration.

-h, --help

Show this help message and exit.

--to-path=<path>

Path to a directory where the migrated configuration files should be written.

--verbose

Enable verbose output.

Example

The following example shows how to migrate a legacy configuration file to the current format:

bin/neo4j-admin server migrate-configuration --from-path=/path/to/legacy/neo4j-enterprise-5.9.0/conf/ --to-path=/path/to/new/neo4j-enterprise-5.26.1/conf/
Example output
Keeping original user-logs.xml file at: /path/to/new/neo4j-enterprise-5.26.1/conf/user-logs.xml.old
User logging configuration xml file generated: /path/to/new/neo4j-enterprise-5.26.1/conf/user-logs.xml
Keeping original server-logs.xml file at: /path/to/new/neo4j-enterprise-5.26.1/conf/server-logs.xml.old
Server logging configuration xml file generated: /path/to/new/neo4j-enterprise-5.26.1/conf/server-logs.xml
server.directories.import=import UNCHANGED
server.bolt.enabled=true UNCHANGED
server.http.enabled=true UNCHANGED
server.https.enabled=false UNCHANGED
server.metrics.csv.rotation.compression=zip UNCHANGED
server.jvm.additional=-XX:+UseG1GC MIGRATED -> server.jvm.additional=-XX:+UseG1GC
server.jvm.additional=-XX:-OmitStackTraceInFastThrow MIGRATED -> server.jvm.additional=-XX:-OmitStackTraceInFastThrow
server.jvm.additional=-XX:+AlwaysPreTouch MIGRATED -> server.jvm.additional=-XX:+AlwaysPreTouch
server.jvm.additional=-XX:+UnlockExperimentalVMOptions MIGRATED -> server.jvm.additional=-XX:+UnlockExperimentalVMOptions
server.jvm.additional=-XX:+TrustFinalNonStaticFields MIGRATED -> server.jvm.additional=-XX:+TrustFinalNonStaticFields
server.jvm.additional=-XX:+DisableExplicitGC MIGRATED -> server.jvm.additional=-XX:+DisableExplicitGC
server.jvm.additional=-XX:-RestrictContended MIGRATED -> server.jvm.additional=-XX:-RestrictContended
server.jvm.additional=-Djdk.nio.maxCachedBufferSize=1024 MIGRATED -> server.jvm.additional=-Djdk.nio.maxCachedBufferSize=1024
server.jvm.additional=-Dio.netty.tryReflectionSetAccessible=true MIGRATED -> server.jvm.additional=-Dio.netty.tryReflectionSetAccessible=true
server.jvm.additional=-Djdk.tls.ephemeralDHKeySize=2048 MIGRATED -> server.jvm.additional=-Djdk.tls.ephemeralDHKeySize=2048
server.jvm.additional=-Djdk.tls.rejectClientInitiatedRenegotiation=true MIGRATED -> server.jvm.additional=-Djdk.tls.rejectClientInitiatedRenegotiation=true
server.jvm.additional=-XX:FlightRecorderOptions=stackdepth=256 MIGRATED -> server.jvm.additional=-XX:FlightRecorderOptions=stackdepth=256
server.jvm.additional=-XX:+UnlockDiagnosticVMOptions MIGRATED -> server.jvm.additional=-XX:+UnlockDiagnosticVMOptions
server.jvm.additional=-XX:+DebugNonSafepoints MIGRATED -> server.jvm.additional=-XX:+DebugNonSafepoints
server.jvm.additional=--add-opens=java.base/java.nio=ALL-UNNAMED MIGRATED -> server.jvm.additional=--add-opens=java.base/java.nio=ALL-UNNAMED
server.jvm.additional=--add-opens=java.base/java.io=ALL-UNNAMED MIGRATED -> server.jvm.additional=--add-opens=java.base/java.io=ALL-UNNAMED
server.jvm.additional=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED MIGRATED -> server.jvm.additional=--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
server.jvm.additional=-Dlog4j2.disable.jmx=true MIGRATED -> server.jvm.additional=-Dlog4j2.disable.jmx=true
server.windows_service_name=neo4j UNCHANGED
Keeping original configuration file at: /path/to/new/neo4j-enterprise-5.26.1/conf/neo4j.conf.old

The example output is not to be used to populate a new Neo4j 5.26.1 neo4j.conf file.

The 2025.01 syntactically correct configuration file can be found at /path/to/new/neo4j-enterprise-5.26.1/conf/, where /path/to/new/neo4j-enterprise-5.26.1/conf/ is the value of --to-path=.