Dude crashed, having trouble restoring data base

In all these years I’ve never had to do a restore, but I can’t get it working. I’m running dude 6.46.4 and I have months worth of daily backups.

Per the instructions I tried /dude import-db backup-file=dudedatabasebackup.db and got an error message that import failed
I then set dude to disabled and deleted the data base
Now when I try to import the data base I get Status: Import Failed

What am I doing wrong?

Verify you have the current DUDE installation pointing at a valid use location for the data before the import

use sqlite3 to VACUUM and recover the database, then put back on same position

jmay To make it easier for you

You read the wiki before post the link?
"Procedure is done on v4.0b3 and after it is completed newly generated backups should work in new versions"

those instruction are for old PC version, not for new npk package for RouterOS,
you just make it easier....

To be honest the last time i tried this, it didn’t work, but then the base didn’t break but i just wanted to optimize it further.

But one/two years ago it worked perfectly, I regulated the base, “db failure: database is malformed”. And this solved the problem. The Dude verison is CHR V6.

One single instruction to restore (VACUUM) is better of all that instructions

if “VACUUM” can’t read the database,
neither you can export the database (echo .dump | sqlite3.exe dude.db > dude.sql) [or better “sqlite3.exe dude.db .dump > dude.sql”]

Yup, after the first database repair , I didn’t have any more problems with it, I only occasionally do a vacuum.

Hello
I have an issue with dude.
We used RB3011 with external usb storage in FAT32 and dude.
one day it dead, as other CCR in the past, with the internal flash corrupted.

We got the dude files, the dude db (40mbyte)
and a downloaded dude.db (with dude not running) some days before crashing.

We are unable to restore it.
we tried the sqllite procedure with no success.
can someone help us?
we dont need historical data, just map and devices monitored.
thank you

The db contain IP, username and password of all devices, is a security risk share it on forum.
And find a MikroTik consultant do not guarantee his knowledge is sufficent for recovery a SQLite database.

Sono in difficoltà, non so come consigliarvi…

try this on file from DOS command line:
C:\Users\Rextended\Desktop\BACKUP\dude>sqlite3 dude.db VACUUM

C:\Users\Rextended\Desktop\BACKUP\dude>sqlite3 dude.db
SQLite version 3.33.0 2020-08-14 13:23:32
Enter “.help” for usage hints.
sqlite> delete from outages;
sqlite> delete from chart_values_raw;
sqlite> delete from chart_values_10min;
sqlite> delete from chart_values_2hour;
sqlite> delete from chart_values_1day;
sqlite> VACUUM;
sqlite>.quit

C:\Users\Rextended\Desktop\BACKUP\dude>
After that fresh start dude service, after full start, stop dude service, after full stop, replace the modified dude.db with the cleaned one, restart dude service