Try recovering your username/password using Robomongo.
Once installed please follow the steps below:
Start the UniFi controller (To be able to access the database with the password, the Unifi controller must be running. )
Create a new connection in Robomongo, leave all settings as it is except the port which needs to be changed to "27117". (Name can be set to UniFi)
Click on save so that the settings are saved.
Select the new connection in the list and click on "Connect"
Now you are connected to the UniFi database. In the left panel select 'ace'. Then right click on 'admin' and select view document.
1) Go here: https://quicklyhash.com/
2) Select "SHA-512 / crypt(3) / $6$" as the Algorithm
3) Put the desired password as your Input Data (this example uses "password")
4) Use "9Ter1EZ9$lSt6" as the Salt.
5) Hit "Generate (Over Secure Connection)