Some customer of [WeKan Commercial Support](https://wekan.fi/commercial-support/) ordered restore and repair of WeKan MongoDB database at UCS appliance. This was needed when changing back to previous UCS 4.x major version, when in new major UCS 5.x version Docker containers were all the time crashing and restarting, or something else got broken. Here are commands that were used while repairing.
- MongoDB does not recover from sudden power failure cleanly
- Disk comes full, that is worst case. Recommended are daily backups, in this case sometimes repair does not work well enough.
1. SSH to UCS appliance as root:
```
ssh root@192.168.0.100
```
2. If backup or raw database files is at external USB harddrive, look where it is inserted:
```
ls /dev
fdisk -l /dev/sdb
fdisk -l /dev/sdc
fdisk -l /dev/sdd
```
2. If external USB drive has NTFS file format, and mount complains about not having NTFS support, install NTFS support to Linux:
```
apt install ntfs-3g
```
3. Mount USB drive to /mnt
```
mount /dev/sdd1 /mnt
```
4. Stop WeKan Docker containers. If copying raw database files, WeKan and MongoDB should not be running, so that MongoDB would not be even more corrupted. (If MongoDB is running, and you have mongodump backup, you can [Backup with mongorestore](Backup)
```
docker stop wekan-db wekan-app
```
5. Find WeKan database raw files. MongoDB has various database engines, like WiredTiger, how to save raw data compressed, or other formats. WiredTiger is file format to save compressed MongoDB data. Similar like MySQL has ISAM, InnoDB etc.
```
apt -y install mlocate
updatedb
locate WiredTiger.wt
```
It can show for example USB drive and Docker container directory: