Community discussions

MikroTik App
 
jmay
Member
Member
Topic Author
Posts: 327
Joined: Tue Jun 23, 2009 8:26 pm

Dude crashed, having trouble restoring data base

Mon Jun 07, 2021 6:00 pm

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?
 
skullzaflare
newbie
Posts: 34
Joined: Tue Apr 12, 2016 12:01 am

Re: Dude crashed, having trouble restoring data base

Tue Jun 08, 2021 11:36 pm

Verify you have the current DUDE installation pointing at a valid use location for the data before the import
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 4571
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: Dude crashed, having trouble restoring data base

Wed Jun 09, 2021 1:50 am

use sqlite3 to VACUUM and recover the database, then put back on same position
 
nikola89381
newbie
Posts: 26
Joined: Wed May 17, 2017 4:46 pm

Re: Dude crashed, having trouble restoring data base

Thu Jun 10, 2021 2:28 pm

use sqlite3 to VACUUM and recover the database, then put back on same position
https://wiki.mikrotik.com/wiki/Manual:T ... _db_repair

jmay To make it easier for you
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 4571
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: Dude crashed, having trouble restoring data base

Thu Jun 10, 2021 4:54 pm

use sqlite3 to VACUUM and recover the database, then put back on same position
https://wiki.mikrotik.com/wiki/Manual:T ... _db_repair

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....
 
nikola89381
newbie
Posts: 26
Joined: Wed May 17, 2017 4:46 pm

Re: Dude crashed, having trouble restoring data base

Thu Jun 10, 2021 5:51 pm

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.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 4571
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: Dude crashed, having trouble restoring data base

Thu Jun 10, 2021 5:53 pm

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"]
 
nikola89381
newbie
Posts: 26
Joined: Wed May 17, 2017 4:46 pm

Re: Dude crashed, having trouble restoring data base

Thu Jun 10, 2021 5:58 pm

Yup, after the first database repair , I didn't have any more problems with it, I only occasionally do a vacuum.
 
User avatar
Maggiore81
Member
Member
Posts: 383
Joined: Sun Apr 15, 2012 12:10 pm
Location: Italy
Contact:

Re: Dude crashed, having trouble restoring data base

Wed Jul 21, 2021 10:10 am

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
Dott. Elia Spadoni
---
Network Administrator
MTCNA, MTCRE, MTCTCE, MTCINE, MTCWE, MTCSE
Spadhausen Internet Provider
Ravenna, ITALY
http://www.spadhausen.com
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 4571
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: Dude crashed, having trouble restoring data base

Wed Jul 21, 2021 10:26 am

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...
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 4571
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: Dude crashed, having trouble restoring data base

Wed Jul 21, 2021 6:19 pm

try this on file from DOS command line:

DOS code

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

Who is online

Users browsing this forum: No registered users and 15 guests