Recovering bandwidth.db on windows after power failure (Solved)

You need to specify the path to the sqlite database dump. This command trying to find it in the current location.
Perhaps it’s stored somewhere else, not in c:\

1 Like

OK so i did try to specify the path, but it seems to error out

at the end I manually killed it as it was doing nothing

image

it should be .output, not output (the point before output is a part of the command)

1 Like

one dumb question when do I know it is finished dumping?

because the dump file is empty

image

Yes I get this back:

I doubt the commands are doing much when there is no output from the CLI

image

no, you need the “;” at end of command, its a sqlite end of command.

do a ;

it will error, then try again

so I did that and it says “database disk image is malformed” for both of the commands

ok, so now get back into that sqlite prompt

.\sqlite3 d:\bandwidth.db and paste in below; the . is needed :wink:

.mode insert
.output d:\dump_all.sql
.dump
.exit

Now check the size of dump_all.sql - you might need to F5 in windows explorer…

is it zero ? if it is, then the DB is lost, so back it up i.e rename it to bandwidthdb.bad, and make sure there is no file called bandwidth.db - then scroll up and I’ve pasted some SQL, run;

.\sqlite3 d:\bandwidth.db and paste the sql in, then exit - the file should be re-created on the D: and then try and start storage node.

Ok not it is a full file.
I have executed this command
image
And bandwidth.db file has been created and is slowly increasing in size
I suppose that is good?

yep this is very good :slight_smile: once that has returned and finished, you should have a bandwidthdb with some size.

try starting your node, hopefully no more DB errors :slight_smile:

1 Like

Hey guys thanks for all the help. The Database is recovered and it works well now.

If someone is reading this down the line and is trying to recover their bandwidth.db on windows go sequentially down the chat

Thanks a gain.

3 Likes