Ancestors

Written by slamp on 2025-01-19 at 15:20

A little story about my journey to upgrade the #MongoDB version and my #Unifi Network Application #controller.

When reading the release note of #Ubiquiti Unifi Network Application (The controller), I noticed that the MongoDB version supported was increased.

UniFi Network Application 7.5 and newer requires MongoDB 3.6 and Java 17.
Version 7.5 till 8.0 supports up to MongoDB 4.4.
Version 8.1 and newer supports up to MongoDB 7.0.
Version 9.0 and newer supports up to MongoDB 8.0 and Java 17/21.

I'm running MongoDB 3.6 on my #Raspberry #PI 4, and I can upgrade it !

The last security update for MongoDB 3.6 was in April 2021, almost 4 years ago.

Unifi controller was 7.5.176 when I started this journey. (I'm using https://hub.docker.com/r/jacobalberty/unifi )

1/n

=> More informations about this toot | More toots from slamp@hachyderm.io

Written by slamp on 2025-01-19 at 15:20

Here is the plan:

upgrade MongoDB to 4.4

upgrade Network Application controller to 8.1.113

upgrade MongoDB to 5.0, 6.0, 7.0

upgrade Network Application to 8.6.9

upgrade MongoDB to 8.0

upgrade Network Application to 9.0.108

Well that was the plan but, I can't upgrade directly from MongoDB 3.6 to 4.4, I had to go through 4.0, 4.2, 4.4. Also, I read that there were some issues with upgrade from 3.6 to 4.0.0 and the advice was to start with 4.0.1

So my plan was the following: 3.6.23 -> 4.0.1 -> 4.0.28 -> 4.2.1 -> 4.2.24 -> 4.4.1 -> 4.4.29

(second version of each major version followed by the last version of each major version)

2/n

=> More informations about this toot | More toots from slamp@hachyderm.io

Written by slamp on 2025-01-19 at 15:20

For each version, I did the following:

Stop Unifi network application
Backup the database
 mongodump --archive=unifi.archive --db=unifi
 mongodump --archive=unifi_stat.archive --db=unifi_stat
Stop MongoDB
Upgrade the Docker image version to n
Start MongoDB container
Start Unifi network application
Tests
Connect to Mongodb and set the feature compatibility version to n

https://www.mongodb.com/docs/manual/release-notes/8.0-upgrade-standalone/

This went fine until I tried to upgrade to 4.4.29. The MongoDb container was not starting.

Earlier, I had a warning but for an upper version "WARNING: MongoDB 5.0+ requires a CPU with #AVX support, and your current system does not appear to have that!"

3/n

=> More informations about this toot | More toots from slamp@hachyderm.io

Written by slamp on 2025-01-19 at 15:20

Indeed, #MongoDb 4.4.29 needs #ARM v8.2-A and #Raspberry #PI 4 is ARM v8.0-A. I had to stop at 4.4.18.

Plan B:

Move MongoDB to a #Synology NAS that has a #Ryzen CPU

I installed MongoDB 4.4.18, exposed the port, set a user/password with ACL.

To restore the database I used

mongorestore --uri="mongodb://user:pass@nas:27017/?authSource=admin" --archive=unifi.archive --db=unifi
mongorestore --uri="mongodb://user:pass@nas:27017/?authSource=admin" --archive=unifi_stat.archive --db=unifi_stat

I updated the Unifi network application container to use the new URI and user/pass and it worked !!!

4/n

=> More informations about this toot | More toots from slamp@hachyderm.io

Written by slamp on 2025-01-19 at 15:20

I love #dopamine !

I continued the upgrades:

upgrade Network Application controller to 8.1.113

upgrade MongoDB to 5.0, 6.0, 7.0

upgrade Network Application to 8.6.9

upgrade MongoDB to 8.0

upgrade Network Application to 9.0.108

And voila!

5/n

=> View attached media

=> More informations about this toot | More toots from slamp@hachyderm.io

Toot

Written by slamp on 2025-01-19 at 15:20

I took the opportunity to install a #mongodb #exporter to monitor the database with #Prometheus and #Grafana

https://github.com/percona/mongodb_exporter

6/6

=> View attached media

=> More informations about this toot | More toots from slamp@hachyderm.io

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113855694180269845
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
302.290597 milliseconds
Gemini-to-HTML Time
2.364767 milliseconds

This content has been proxied by September (3851b).