user manager eats up my disk

I want to share my experiences, might be usefull for others struggling with the same problems:

  1. user manager’s database path setting is NOT permanent: it doesn’t survive a reboot
  2. no external storage was working with user manager: neither microSD slot nor USB storage
  3. user manager’s database is an sqlite3 database, can be moved to another device by “copy-paste”. I used SCP to do so and a SD card reader attached to my PC. (Mikrotik seems not support direct file copy so need some magic in a way or in another)
  4. user manager’s database is not encrypted
  5. user manager’s database can be opened in bash with help of sqlite3 command
  6. too many sessions exist somehow at database level

So what helped me at the end was compacting the database. 133 MB sqlite3 database because a 111 KB big file what is fine even for the internal storage.

So the final solution was in my Ubuntu 18.04 LTS machine:

  1. First you have to download user-manager directory from the router
  2. install sqlite3 utility:
apt install sqlite3
  1. open user managers database:
sqlite3 sqldb
  1. truncate sessions table:
delete from session;
  1. compact the database:
VACUUM;
  1. press CTRL+D to exit from the sqlite3 utility
  2. Override original files on the router with the compacted ones

Comment:
I’m far dissatisfied with the external storage capability of my Mikrotik router. I would be happy if support would step in and help to debug as I read similar experiences on the internet from others too.

Useful links: