This will clear the UniFi admin password and allow you to reset it.
To begin, you'll need to download an old version of MongoDB Compass on the machine running your UniFi controller. 1.26.1 seems to work and can be downloaded for Windows here. Once downloaded, extract the ZIP file and open MongoDBCompass.exe.
Now, make sure you exit out of your UniFi controller. We'll be accessing the database directly and you'll need to make sure it is shut down.
Now, open a command prompt and navigate to your UniFi install folder located at [USER]\Ubiquity UniFi\ on Windows. Navigate into the bin folder. Now, run the following command to start the database in a way we can access it: .\mongodb.exe --dbpath ../data/db/. If you're accessing it from another machine, add --bind_ip [ip] to it.
Open MongoDB Compass and connect to mongodb://localhost. Once logged in, expand ace on the sidebar and op