Unifi controller
configurationoperating_systemsfreebsdunifi-jail

Important files

/var/db/mongodb/mongod.log
/usr/local/share/java/unifi/data/system.properties
/usr/local/etc/mongodb.conf

Update mongodb36 to mongodb44

You will notice that this is necessary when you get this error message in /var/db/mongodb/mongod.log:

"ctx":"initandlisten","msg":"Failed to start up WiredTiger under any
compatibility version. This may be due to an unsupported upgrade or
downgrade."}

If running in a jail add allow.mlock to the jail.conf, because it is required since mongodb42 and otherwise will log in /var/db/mongodb/mongod.log:

Failed to mlock: Cannot allocate locked memory.

A installation of all intermediate versions of mongodb is required for the update says the internet. But freebsd only keeps the really necessary versions as packages. So you will use pkg to install mongodb40 -> mongodb42 -> mongodb44 and with each version:

pkg install mongodb40
service mongodbd restart
mongo --port 27017
db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )

pkg install mongodb42
service mongodbd restart
# this will fail, if you have it running in a jail and forgot to add allow.mlock in jail.conf
mongo --port 27017
db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } )

pkg install mongodb44
service mongodbd restart
mongo --port 27017
db.adminCommand( { setFeatureCompatibilityVersion: "4.4" } )

Note that the command mongo --port 27017 does not spawn a new instance of mongodb, but connects to an existing instance and allows administration.

If you get this error in /var/db/mongodb/mongod.log:

"ctx":"initandlisten","msg":"Error setting up
listener","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"Permission
denied"}}}

You will probably be able to fix it with chmod 1777 /tmp.


The blog of haraschak contained a part of this solution for an earlier version. In appriciation for that I link you here.

top