With the release of Neo4j 4 on Aura, you may wish to take advantage of the new features using an existing database. If you have already been using 3.5 on Aura, please see this article for the steps to convert to using Neo4j 4.
If you have been using either the enterprise or community edition of Neo4j on your local server or workstation, this is the right article to review.
Creating a dump file of Neo4j
For the full explanation of how to export a dump of Neo4j, please see our documentation on the topic. The abbreviated version is:
- Log into the server running your Neo4j database.
- cd to the directory containing your Neo4j installation. If you are unsure of the location and you are running on your local machine, you can open a terminal in Neo4j Desktop to navigate to it.
- Stop the existing database by running bin/neo4j stop.
- Make sure the backups directory we're going to use exists by running mkdir -p backups/graph.db.
- Take the backup bin/neo4j-admin dump --database=graph.db --to=backups/graph.db/`date +%Y%m%d`.dump.
Create a new database
On the main Aura console page, scroll to the bottom of the page and choose "Create a database".
Under "Neo4j Version" choose 4, and select the region you want your database deployed in. This does not need to be the same region as your existing database.
As always, copy the password that is displayed for future use. Let the database creation complete before moving to the next step.
Import to the database just created
The final step will be to import your data.
If the dump file is smaller than 4GB you can do this in the Aura console otherwise please use the command line tool push-to-cloud.
Open your new database and click the "Import Data" tab. Then click the "Choose file" button to navigate to the location of the "graph.db.dump" file saved in the first step.
You'll be prompted to confirm you want to overwrite all of the existing data in your new database; click Upload to continue.
Wait for import to complete
We recommend getting a coffee, tea, or other favourite beverage at this step. It will take anywhere from a few minutes for a small database, to potentially an hour or more if you have an exceptionally large amount of data and a slow internet connection, for the import to finish.
Check that the data was imported properly
Before you switch your application over to use the new database, you'll want to perform some tests to make sure that everything is working as expected. One quick way to do this is to open a browser window for both the original and new databases and run this Cypher query against them, comparing the output:
optional match (n)-[r]-()
return count(n) as Nodes, count(r) as Relationships
The numbers of nodes and relationships should be the same. If they are not, please open a ticket with our support team.
Note that you'll still want to run whatever tests your developers have in place to be safe.
Enjoy the new features available
With the exception of running multiple databases, there are a number of improvements available in Neo4j 4. We recommend reviewing the complete list of deprecations, additions, and compatibility notes for both versions 4.0 and 4.1 to gain a complete view of these changes.