Ubiquiti Unifi upgrade to 8.2

Note that when upgrading Unifi to the most recent packages (8.2.93 is the latest as I write this), it will want to upgrade Mongo from v5 to v6.
It's worth checking the compatibility setting first as mine was set to 4.4 which isn't valid in Mongo v6. This caused mongo to refuse to start.

If pkg wants to upgrade Mongo, I would suggest doing the following first

Run mongo localhost:27117 to connect to the Unifi mongo instance.

Use the commands below to check the combability setting and change it to 5 if required

Code:
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )
(See https://www.mongodb.com/docs/v6.0/r...ade-standalone/#feature-compatibility-version)

You can then run the pkg upgrade as normal, and the services should start correctly.

Now I just have to see what to do about the mongo client now being removed. There's very few reasons to use it with Unifi but it means that I now have no way of viewing the raw mongo data if needed or configuring that compatibility setting if it needs to change in future. Looks like it might be getting close to the point where I have to just run a Linux vm with one of the original Ubiquiti packages like I do with UISP.
 
If you have trouble getting mongo to run and you have an older FreeBSD jail you've been moving up for years. Check if mlock is enabled in your jail preferences.

I found I couldn't get any MongoDB shell to work until I did so and once I did so I was able to apply the compatibility flag above and updating from Unifi 8.1 (and it's use of MongoDB 5.0) to Unifi 8.2 (which requires the install of MongoDB 6.0) was successful.

Does anyone know of a MongoDB shell that works on FreeBSD?
 
I'm sure I already put this in a reply but it seemed to have gone...

Referencing the post below, I was able to install node/npm and use the mongosh node package to get a working mongodb shell.
 
Back
Top