Updating and multiple versions

I've been using Neo4j 3.3.1 for a while now and have a number of live projects that use that version. I've never felt confident enough (and there has never been budget) to upgrade the projects so they are still on that version.

However, I don't want to be stuck on that version locally forever, so I uninstalled 3.3.1 via apt-get (I'm on Ubuntu 16.04) and installed Neo4j Desktop with the aim of adding the existing databases to that somehow and then creating new databases with the latest version of Neo4j.

I notice that the lowest avaiable version that can be used in Neo4j Desktop seems to be 3.4.0 though, so I am wondering if I will HAVE to upgrade all my projects to be able to do what I need?

What is my best course of action please?

Thanks so much!

Also, I just created a new graph in Neo4j Desktop and it shows as "3.5.6 Enterprise". I would like to use the community edition though. Do I need to do something differently to use the community edition?

OK. So I decided to go for it and upgrade the databases on my local machine. I'm now having a nightmare. I installed Neo4j Desktop to start with just to test it out. I now can't remove that. Ubuntu software fails (I just click remove, restart and Neo4j Desktop is still there). dpkg --list doesn't list neo4j desktop, so I can't use "apt-get remove" to remove it. I am unsure if I can just delete the files at:

"/home/doug/.config/Neo4j Desktop/Application/neo4jDatabases/database-a9a3b165-ae68-4b39-8d0c-35a4d773f17a/installation-3.5.6"

Does anyone know if that would do it?

I managed to install Neo4j 3.3.9 server and start each database. They all look to have converted fine as when I view in Neo4j browser I can see all the data and the 3.3.9 version number.

I then uninstalled Neo4j 3.3.9 and installed Neo4j 3.5.7 via bash using "sudo apt-get install neo4j". I did this because I am trying to replicate the steps that I will be taking on the live servers and I notice that the lowest version listed in Neo4j Desktop is 3.4, so I assume that I would need to upgrade in the server edition, uninstall version 3.5.7 server and then point Neo4j desktop at the database folder.

When I try to run 3.5.7 server using "sudo service neo4j start" I get:

● neo4j.service
   Loaded: not-found (Reason: No such file or directory)
   Active: failed (Result: start-limit-hit) since Tue 2019-07-09 13:23:36 BST; 16min ago
 Main PID: 26242 (code=exited, status=1/FAILURE)

Jul 09 13:23:36 doug-ubuntu systemd[1]: neo4j.service: Unit entered failed state.
Jul 09 13:23:36 doug-ubuntu systemd[1]: neo4j.service: Failed with result 'exit-code'.
Jul 09 13:23:36 doug-ubuntu systemd[1]: neo4j.service: Service hold-off time over, scheduling restart.
Jul 09 13:23:36 doug-ubuntu systemd[1]: Stopped Neo4j Graph Database.
Jul 09 13:23:36 doug-ubuntu systemd[1]: neo4j.service: Start request repeated too quickly.
Jul 09 13:23:36 doug-ubuntu systemd[1]: Failed to start Neo4j Graph Database.
Jul 09 13:23:36 doug-ubuntu systemd[1]: neo4j.service: Unit entered failed state.
Jul 09 13:23:36 doug-ubuntu systemd[1]: neo4j.service: Failed with result 'start-limit-hit'.
Jul 09 13:25:27 doug-ubuntu systemd[1]: Stopped Neo4j Graph Database.
Jul 09 13:25:28 doug-ubuntu systemd[1]: Stopped Neo4j Graph Database.

I checked the the JRE is version 8:

openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.16.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)

I am wondering if this is failing because I have Neo4j Desktop still installed, although I can't remove it to find out!

Any ideas please?

Found the answer by running "journalctl -e -u neo4j" to view the full error log. Turns out that it was an APOC jar that was installed for 3.3.x but not compatible with 3.5.x. Removing the jar file solved it.

I thought the following might be helpful to anyone wanting to update Neo4j on Ubuntu. After a fair bit of digging these were the steps I adopted and it SEEMS to have worked well.

Make full backups of:

  • /etc/neo4j/neo4j.conf
  • /var/lib/neo4j/data (or whereever you have set as your DB location in neo4j.conf dbms.directories.data=xxxx)
  • /var/lib/neo4j/certificates

Stop Neo:
sudo service neo4j stop

Uninstall neo4j 3.3.1 (or whatever version you're on):
sudo apt-get remove neo4j

Update apt-get:
wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.org/repo stable/' | sudo tee -a /etc/apt/sources.list.d/neo4j.list
sudo apt-get update

Install the latest version of whatever version your currently on. I was on 3.3.1 so I needed 3.3.9:
sudo apt-get install neo4j=1:3.3.9

Allow upgrade:
sudo nano /etc/neo4j/neo4j.conf
Set dbms.allow_upgrade=true

Start database to upgrade it from 3.3.1 to 3.3.9:
sudo service neo4j start

Uninstall 3.3.9 and install 3.5.7 (or whatever the latest version is) as follows:
sudo service neo4j stop
sudo apt-get remove neo4j
sudo apt-get install neo4j

Replace any custom settings from original neo4j.conf
sudo nano /etc/neo4j/neo4j.conf
Set dbms.allow_upgrade=true

Start database to upgrade it from 3.3.9 to 3.5.7
sudo service neo4j start

For some reason I needed to also then restart to actually make it upgrade:
sudo service neo4j restart
You should now see some feedback about the upgrade if you check the neo4j status:
sudo service neo4j status
sudo service neo4j stop

Prevent further upgrades:
sudo nano /etc/neo4j/neo4j.conf
Comment out dbms.allow_upgrade=true

Set neo4j to run on boot:
sudo systemctl enable neo4j

Reboot to test and check that your version is now showing the latest in the Neo4j Browser.

Don't forget to check your cypher in case there are changes that affect your queries.

1 Like