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. 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-4.4.10/conf/ --to-path=/path/to/new/neo4j-enterprise-5.25.1/conf/
Example output
Keeping original user-logs.xml file at: /neo4j-enterprise-5.1.0/conf/user-logs.xml.old
User logging configuration xml file generated: /neo4j-enterprise-5.1.0/conf/user-logs.xml
Keeping original server-logs.xml file at: /neo4j-enterprise-5.1.0/conf/server-logs.xml.old
Server logging configuration xml file generated: /neo4j-enterprise-5.1.0/conf/server-logs.xml
dbms.directories.import=import MIGRATED -> server.directories.import=import
dbms.tx_state.memory_allocation=ON_HEAP MIGRATED -> db.tx_state.memory_allocation=ON_HEAP
dbms.connector.bolt.enabled=true MIGRATED -> server.bolt.enabled=true
dbms.connector.http.enabled=true MIGRATED -> server.http.enabled=true
dbms.connector.https.enabled=false MIGRATED -> server.https.enabled=false
metrics.csv.rotation.compression=zip MIGRATED -> server.metrics.csv.rotation.compression=zip
dbms.jvm.additional=-XX:+UseG1GC MIGRATED -> server.jvm.additional=-XX:+UseG1GC
dbms.jvm.additional=-XX:-OmitStackTraceInFastThrow MIGRATED -> server.jvm.additional=-XX:-OmitStackTraceInFastThrow
dbms.jvm.additional=-XX:+AlwaysPreTouch MIGRATED -> server.jvm.additional=-XX:+AlwaysPreTouch
dbms.jvm.additional=-XX:+UnlockExperimentalVMOptions MIGRATED -> server.jvm.additional=-XX:+UnlockExperimentalVMOptions
dbms.jvm.additional=-XX:+TrustFinalNonStaticFields MIGRATED -> server.jvm.additional=-XX:+TrustFinalNonStaticFields
dbms.jvm.additional=-XX:+DisableExplicitGC MIGRATED -> server.jvm.additional=-XX:+DisableExplicitGC
dbms.jvm.additional=-XX:MaxInlineLevel=15 MIGRATED -> server.jvm.additional=-XX:MaxInlineLevel=15
dbms.jvm.additional=-XX:-UseBiasedLocking MIGRATED -> server.jvm.additional=-XX:-UseBiasedLocking
dbms.jvm.additional=-Djdk.nio.maxCachedBufferSize=262144 MIGRATED -> server.jvm.additional=-Djdk.nio.maxCachedBufferSize=262144
dbms.jvm.additional=-Dio.netty.tryReflectionSetAccessible=true MIGRATED -> server.jvm.additional=-Dio.netty.tryReflectionSetAccessible=true
dbms.jvm.additional=-Djdk.tls.ephemeralDHKeySize=2048 MIGRATED -> server.jvm.additional=-Djdk.tls.ephemeralDHKeySize=2048
dbms.jvm.additional=-Djdk.tls.rejectClientInitiatedRenegotiation=true MIGRATED -> server.jvm.additional=-Djdk.tls.rejectClientInitiatedRenegotiation=true
dbms.jvm.additional=-XX:FlightRecorderOptions=stackdepth=256 MIGRATED -> server.jvm.additional=-XX:FlightRecorderOptions=stackdepth=256
dbms.jvm.additional=-XX:+UnlockDiagnosticVMOptions MIGRATED -> server.jvm.additional=-XX:+UnlockDiagnosticVMOptions
dbms.jvm.additional=-XX:+DebugNonSafepoints MIGRATED -> server.jvm.additional=-XX:+DebugNonSafepoints
dbms.jvm.additional=-Dlog4j2.disable.jmx=true MIGRATED -> server.jvm.additional=-Dlog4j2.disable.jmx=true
dbms.windows_service_name=neo4j MIGRATED -> server.windows_service_name=neo4j
Keeping original configuration file at: /neo4j-enterprise-5.1.0/conf/neo4j.conf.old

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

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