Unifi: Unifi Controller – repairing the database

How to Repair a Database on Debian-based Linux


1. Stop the UniFi service

service unifi stop

2. Repair the database with this command:

mongod --dbpath /usr/lib/unifi/data/db --smallfiles --logpath /usr/lib/unifi/logs/server.log --repair

3. Finally, restart the UniFi service:

service unifi start
NOTE: If this process was performed as root the file ownership may have changed. This can be changed with: chown -R unifi:unifi /usr/lib/unifi/data/db/
chown -R unifi:unifi /usr/lib/unifi/logs/server.log

If you still have suspected database issues please contact Ubiquiti Support.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.