Database import using neo4j-admin on Ubuntu fails (following tutorial)

Hey all,

Running into a frustrating issue on neo4j 4.2.1 Community Edition on Ubuntu 20.04.1. I will be needing to use the neo4j-admin import tool for larger files, and have been attempting to follow the instructions
in the tutorial here:

I stopped neo4j, and deleted the existing neo4j database (/var/lib/neo4j/data/databases/neo4j). I have also tried deleting /var/lib/neo4j/transactions/neo4j as suggested in this recent thread.

I then followed all instructions in the tutorial, and the import appears to complete successfully. However, when I attempt to start neo4j and then load the database in the browser, I run into the following:

Database "neo4j" is unavailable, its status is "offline."

I have tried switching to system and running

create database neo4j

as suggested here, but receive:

Unsupported administration command: CREATE DATABASE Neo4j

One potential issue is that the tutorial recommends using /bin/neo4j start, which I understand is now not recommended with sudo systemctl start neo4j being preferred, but neither seem to make a difference for me. I have also tried changing the owner of the newly created database (in databases and in transactions) to user neo4j, but that doesn't help either.

I've also tried doing all of the above with a fresh install of neo4j. Actually, when I do this, the first time I start neo4j, I can see the neo4j database on the very first try, but none of the data is loaded as expected. If I stop and start it again, the offline issue occurs.

Any advice would be greatly, appreciated, I don't know what to try next.


Okay, realized my very stupid error... did not change permissions for all files in the subdirectories. I do think it would be very helpful to future users to update the documentation to reflect this necessary step. Or, if I missed this in the instructions or there are more up-to-date sources, please let me know. :)

I agree @jsimkoff It took me too long to figure out that ownership needed to be part of my workflow for using the neo4j-admin import tool. I usually do not overwrite the default neo4j database and instead create a new database using the --database flag and then make sure to run the following commands:

- `sudo chown -R neo4j:neo4j /var/lib/neo4j/data/transactions/<database_name>`
- `sudo chown -R neo4j:neo4j /var/lib/neo4j/data/databases/<database_name>`

where the path is dependent on your OS. In the Neo4j Desktop or Browser you can then use :use <database_name> to switch to the new database. The prompt will change to your database's name. You can also use the pulldown in the Neo4j Desktop or browser UI to switch databases.


Thanks @stugorf, and thanks for including explicit codes snippets of the solution -- hopefully will help others in the future. :slight_smile:

Just to be sure: does your workflow (creating new databases rather than overwriting neo4j) apply to Community Edition too? I know that it's only possible to run one database at a time in CE, but would expect that you can modify dbms.active_database in neo4j.conf and restart neo4j to switch to the new database.