Unifi needs an old version of MongoDB (<4.0), which prevents systems from updating world because it needs Python 2. The workaround is to run the old version of MongoDB in docker or on an external system. Unifi can be configured to use an external MongoDB. So, it would help if MongoDB was a use flag for this ebuild. Reproducible: Always
My UniFi is locally here working fine with a newer MongoDB? Also no ebuild does enfore '<dev-db/mongo-4.0'?
(In reply to thomas from comment #0) > Unifi can be configured to use an external MongoDB. So, it would help if > MongoDB was a use flag for this ebuild. How is that configured? Per default, unifi starts itself a mongodb process. Are there any options to override that?
I think upstream and need for migration are confusing users into thinking they _need_ <4.0. There was threads about this recently, and seems to be successfully switching to 4.2.x now: https://forums.gentoo.org/viewtopic-p-8541049.html#8541049
How to configure external MongoDB: https://community.ui.com/questions/External-MongoDB-Server/d311a8f8-43b6-4aeb-859d-eefec9dc1bbc Unifi officially supports only 3.6: https://community.ui.com/questions/Mongo-3-4-End-of-Life-UniFi-Controller/45c6f996-9d51-4077-869f-215b0c521eb2
Current unifi release notes say "We support MongoDB 3.6 since 5.13.10, older controllers only support up to MongoDB 3.4.". I take that to mean "we support mongodb >=3.6 finally". There was a *specific* problem in >=3.6 that has been fixed on their end, I see no reason to believe that support TOPS OUT at 3.6.x. Our ebuilds allow even the very latest mongodb-4.4.x, and I have been testing the latest unstable mongodb all along since I first added the workaround shim in our ebuilds to allow mongodb 3.6+. I have not heard a single report of mongodb compatibility issues. We are still using that shim in unifi-5.6.42-r1. In my opinion, the idea of supporting external-mongodb is a completely separate topic from mongodb-4.x support. We have full mongodb-4.x support. Would you be willing to whip up an ebuild patch which adds IUSE="external-mongodb" which controls the dependencies and either adds an example entry to system.properties and/or gives some information in pkg_postinst to explain how to set this up?
Thinking about this just a bit more, I don't think "external-mongodb" is quite the right flag name. That would be used for whether to use a bundled copy or not. Possibly IUSE="remote-mongodb" ?
OK, so I made a backup from within Unifi and reinstalled Unifi and MongoDB (4.4.1) from scratch and then restored the backup. It works. Unifi itself sets the compatibility level for MongoDB to 3.6. So, the only problem in migrating from 3.6 to 4.4 is if one wants to migrate via the MongoDB database (without Unifi backup/restore), which means migrating over version 4.0 to 4.4. So, I do not need the use flag anymore.