Upgrade from older versions
This page contains the list of new features and breaking changes of the driver from version 4.4 to 5.x. For a full list of changes, see the Driver → Changelog.
The Neo4j Drivers Migration Assistent simplifies the upgrade process by contextualizing the changelog to your application. It scans your codebase for usage of deprecations and removals, and brings them up to you. The tool doesn’t automatically rewrite your code; it only points at where action is needed, providing in-context information on how each hit should be addressed.
The latest driver version of the 5.x series (5.27) is compatible with Neo4j server both 4.4 and 5.x, so you can upgrade the driver before you upgrade the server. At the same time, the driver version 4.4 is forward compatible with Neo4j server 5.x, so you could also upgrade the server before the driver; however, given that it’s easier to roll back an application upgrade than a server upgrade, it’s recommended to start with the driver.
When upgrading the Neo4j server to a newer version, the Cypher queries in your application may also need updating.
The Drivers Migration Assistent doesn’t cover Cypher changes. See Cypher → Deprecations, additions, and compatibility. |
Recommended steps
Using the migration assistant, the recommended upgrade steps are:
-
Set up the environment for the assistant to work in. Download the Drivers Migration Assistant zip, extract it, and locate yourself in its directory. Then, assuming
python3
andpip3
are already installed,python3 -m venv virtualenvs/neo4j-migration source virtualenvs/neo4j-migration/bin/activate pip3 install -r requirements.txt
-
Run the migration assistant with its default configuration and address all the issues that it surfaces. The
path
argument supports globbing, and can be repeated.python3 main.py -l python /path/*.py /path-recursive/**/*.py
-
Re-run the assistant with the regex parser and check if any more legit issues are raised.
python3 main.py -l python --regex-parser /path/*.py /path-recursive/**/*.py
The regex parser can detect implicit function calls and other hard-to-parse expressions, but is likely to surface more false positives (for more information, see Neo4j Drivers Migration Assistant → Accuracy). You can add any spurious entry to the ignored list, so that the assistant won’t bring them up in future runs.
-
Although the assistant can detect most of the locations where action is needed, a few changelog entries can’t be surfaced in this form, so you should still revise the breaking changes section and audit your codebase for the changes marked with in the table.
-
You are ready to upgrade the driver package to the new version. For example, using
pip
:pip3 install -U neo4j==5.27
New features
Support for Python 3.13The driver is compatible with any Python version starting from 3.7 up to 3.13. |
|
|
Rust extension for performanceThe Rust extension to the Python driver is an alternative driver package that can yield a speedup up to 10x compared to the pure-Python driver. You can install it with |
Export to Pandas Dataframe
|
Type hints for all public APIsAll public objects have type annotations via the typing package. For (optional) use with type checkers and linters. |
Re-authenticationAllows for rotating authentication tokens as well as session-scoped and query-scoped authentication. |
Mutual TLS (mTLS) as second authentication factor (2FA)Allows for configuring client side TLS certificates to authenticate against the server. See Mutual TLS. |
|
Notification filtering APIFiltering allows to receive only a subset of notifications from the server, and to improve performance server-side. |
GQL statuses of queries in the
|
More convenient handling of server-side warnings and notificationsThe new sub-logger If logging is not configured explicitly, the default behavior is for warnings to be logged to stderr via |
TelemetryThe driver sends anonymous API usage statistics to the server.
Use the driver configuration |
Concurrency misuse checksFor local development, run your application with |
Breaking changes and deprecations
The column Assistant
denotes whether the Neo4j Drivers Migration Assistant can detect issues related to the given changelog entry.
Entries with a cross mark require manual inspection.
Deprecated features are likely to be removed in version 6.
Version | Message | Status | Assistant |
---|---|---|---|
5.0 |
Dropped support for Python 3.6. |
Removed |
|
5.0 |
|
Removed |
|
5.0 |
|
Removed |
|
5.0 |
|
Removed |
|
5.0 |
|
Removed |
|
5.0 |
|
Removed |
|
5.0 |
|
Removed |
|
5.0 |
|
Removed |
|
5.0 |
|
Changed |
|
5.0 |
All math operations on |
Changed |
|
5.0 |
|
Removed |
|
5.0 |
|
Changed |
|
5.0 |
|
Changed |
|
5.0 |
|
Removed |
|
5.0 |
|
Removed |
|
5.0 |
|
Deprecated |
|
5.3 |
Package-alias |
Deprecated |
|
5.0 |
|
Deprecated |
property |
5.0 |
Implicit closing of drivers and sessions through |
Deprecated |
|
5.0 |
Import of the following modules is deprecated without replacement, as they are internal and should not be used by client code:
|
Deprecated |
|
5.0 |
|
Deprecated |
|
5.0 |
|
Deprecated |
|
5.0 |
|
Deprecated |
|
5.0 |
Importing submodules from |
Deprecated |
|
5.7 |
Importing |
Deprecated |
|
5.0 |
The following objects are deprecated without replacement, as they are internal and should not be used by client code: |
Deprecated |
|
5.22 |
Class |
Deprecated |
|
5.0 |
Undocumented methods |
Deprecated |
|
5.26 |
Undocumented method |
Deprecated |