Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: frotto on May 15, 2011, 09:37:58 PM



Title: Corrupted wallet.dat - any way of repairing?
Post by: frotto on May 15, 2011, 09:37:58 PM
Hi everybody, my SSD crashed today, and of course, I hadn't made a backup of my wallet.dat file. I managed to restore the file, but when I launch bitcoin, it gives me a '11DbException' error message and then closes itself. Is there any way of restoring the file? I do have the address, just can not access it. :(


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: trentzb on May 15, 2011, 09:58:32 PM
Ouch! Yea having the address won't help much. There is bitcointools (https://github.com/gavinandresen/bitcointools) and IIRC there was another wallet dump/export utility mentioned somewhere on the forums here. Play around with bitcointools and see if you can get anything out of your wallet.dat.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: theymos on May 15, 2011, 10:38:55 PM
Did you delete all other files in the data directory before restoring wallet.dat? Maybe those files are corrupted.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: frotto on May 16, 2011, 05:51:39 AM
Did you delete all other files in the data directory before restoring wallet.dat? Maybe those files are corrupted.
Yes, I did try that, didn't help. :(


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: Matt Corallo on May 16, 2011, 07:44:33 AM
Try running dbdump.py --wallet --datadir=/path/to/corrupt/wallet/ from bitcointools, if you get a reasonable looking data, you might be ok, otherwise well you might try some more advanced BDB recovery tools.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: frotto on May 16, 2011, 12:37:26 PM
Try running dbdump.py --wallet --datadir=/path/to/corrupt/wallet/ from bitcointools, if you get a reasonable looking data, you might be ok, otherwise well you might try some more advanced BDB recovery tools.
Could you please give me a step by step guide how to do this? I'm useless when it comes to python. Thanks!


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: trentzb on May 16, 2011, 04:10:42 PM
Code:
# git clone https://github.com/gavinandresen/bitcointools.git
# cd bitcointools
# ./dbdump.py --wallet --datadir=/point/to/wallet/dir

Use ./dbdump.py --help for other options.




Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: frotto on May 30, 2011, 07:17:24 PM
Code:
# git clone https://github.com/gavinandresen/bitcointools.git
# cd bitcointools
# ./dbdump.py --wallet --datadir=/point/to/wallet/dir

Use ./dbdump.py --help for other options.




I still wasn't able to figure out what to do with these commands. I tried putting them in the python command line, but it did absolutely nothing. Again, I haven't ever worked with python, so any help would be appreciated!  :)


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: grue on May 30, 2011, 09:36:55 PM
Code:
# git clone https://github.com/gavinandresen/bitcointools.git
# cd bitcointools
# ./dbdump.py --wallet --datadir=/point/to/wallet/dir

Use ./dbdump.py --help for other options.




I still wasn't able to figure out what to do with these commands. I tried putting them in the python command line, but it did absolutely nothing. Again, I haven't ever worked with python, so any help would be appreciated!  :)
that's for unix, i believe.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: publickeyhash on May 30, 2011, 09:41:29 PM
How many bitcoins did it contain?
How many bitcoins would you offer for me to repair it? (only if succesfull)


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: frotto on May 31, 2011, 02:06:39 PM
How many bitcoins did it contain?
How many bitcoins would you offer for me to repair it? (only if succesfull)

I'd be willing to send you some bitcoins (3-5) if you help me repair it.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: kjj on May 31, 2011, 02:17:54 PM
You know he could just keep it himself, right?


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: frotto on May 31, 2011, 08:07:28 PM
You know he could just keep it himself, right?

Yeah, well, I would still end up with nothing. :)
I would really like some help with the repairing, though :/


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: SomeoneWeird on June 01, 2011, 12:16:07 PM
You know he could just keep it himself, right?

Yeah, well, I would still end up with nothing. :)
I would really like some help with the repairing, though :/

I'll help, pm me.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: frotto on June 07, 2011, 01:59:15 PM
I was able to get it working and ran it, but the program (dbdump.py) just says "Couldn't open wallet.dat/main, try quitting Bitcoin and running this again." Even tried fixwallet.py, but same result. I guess I just lost 20 BTC. :(


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: SomeoneWeird on June 07, 2011, 02:01:46 PM
I was able to get it working and ran it, but the program (dbdump.py) just says "Couldn't open wallet.dat/main, try quitting Bitcoin and running this again." Even tried fixwallet.py, but same result. I guess I just lost 20 BTC. :(

If your giving up on it, PM me with your wallet file and i'll try and fix it, if I can i'll send most of it back to you :) You've got nothing to lose :P


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: kjj on June 07, 2011, 02:02:14 PM
Was bitcoin still running when you tried the dump?


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: frotto on June 07, 2011, 02:07:27 PM
Was bitcoin still running when you tried the dump?
No it wasn't, I'm not that stupid :) I did this on a virtual computer running Ubuntu Live CD.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: SomeoneWeird on June 07, 2011, 02:13:59 PM
Was bitcoin still running when you tried the dump?
No it wasn't, I'm not that stupid :) I did this on a virtual computer running Ubuntu Live CD.

I have a few hidden tricks up my sleeve for repairing corrupted wallets, but they're time consuming, so if you want I can try :)


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: kjj on June 07, 2011, 02:23:24 PM
I wouldn't mind taking a look too.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: frotto on June 07, 2011, 02:30:35 PM
Sent you guys a PM.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: webwakko on December 06, 2017, 02:30:55 PM
I don't know if it worth to revive this topic, but let's give it a chance.
When I try to work with the reddcointools, which are basicly the same as the bitcointools... I always end up getting a syntaxError : unexpected character after line continuation character.
This is very new to me and I would be happy if someone could give me some direction in it.


Title: Re: Corrupted wallet.dat - any way of repairing?
Post by: bob123 on December 06, 2017, 08:20:44 PM
I don't know if it worth to revive this topic, but let's give it a chance.

Next time just start a new topic.

When I try to work with the reddcointools, which are basicly the same as the bitcointools... I always end up getting a syntaxError : unexpected character after line continuation character.
This is very new to me and I would be happy if someone could give me some direction in it.

As far as i am concerned, bitcointools is for bitcoin and reddcointools is for reddcoin ?
We need a few more information about how this error occured. Did you just run a tool? Or did you write a script?
If you wrote a script by yourself, then as the error message is stating: There is an unexpected character (where it shouln't be).
If you could post the snippet of your code where the error appears, it would be much easier to help you.
If you just ran a (downloaded) script and you get this error, then the tool is 'broken'. But still.. a code snippet would help to find the mistake.