Overview
This article will outline how to repair a UniFi Video database for both Linux and Windows platforms.
Table of Contents
- Steps: How to Repair the Database on Linux
- Steps: How to Repair the Database on Windows
- Related Articles
Steps: How to Repair the Database on Linux
Follow the steps below to repair the database. Begin by accessing UniFi Video via SSH, and then entering the commands provided in each step below.
1. Stop the UniFi Video service:
service unifi-video stop
2. Delete the contents of the journal folder:
rm -rf /usr/lib/unifi-video/data/db/journal/*
3. Switch to the unifi-video user:
su unifi-video
4. Run:
mongod --dbpath /usr/lib/unifi-video/data/db --repair
5. Exit to return to root:
exit
6. Start the UniFi Video service:
service unifi-video start
Steps: How to Repair the Database on Windows
1. Stop the UniFi Video service, by right clicking on the icon in the notifications area and choosing Stop.
2. Open Windows Explorer, browse to C:\ProgramData\unifi-video\data\db\journal. Delete all files within this folder, leaving the folder present, but empty.
3. Open a command prompt as Administrator by using the+r keys and typing ‘cmd’. Right click on the command prompt and choose “Run as Administrator”.
4. Run:
cd C:\ProgramData\unifi-video\bin
5. Run:
mongod.exe --dbpath C:\ProgramData\unifi-video\data\db --repair
Once the process finishes, it will present the command prompt screen once more. Wait until that happens before continuing to the next step.
6. Start the UniFi Video service by right clicking on the icon in the notifications area and choosing Start.
Related Articles
Intro to Networking - How to Establish a Connection Using SSH