Author

Topic: Trouble recovering wallet (Read 1200 times)

staff
Activity: 4284
Merit: 8808
March 03, 2013, 09:37:32 PM
#16
What you can do is try to salvage the wallet.
Salvage doesn't work too well right now, most cases that cause you to need to salvage make the salvage 'fail' (it fails whenever the database layer returns an error). If the wallet is not encrypted I usually recommend people to just use the private key recovery tool: https://bitcointalksearch.org/topic/bitcoin-private-keywalletdat-data-recovery-tool-25091   if you need to recover an encrypted one, I can give you a patch to make the salvage more robust.
legendary
Activity: 3472
Merit: 4801
March 03, 2013, 09:37:08 PM
#15
Lesson to all - do not trust embedding files into Excel.  Granted I am one of the few foolish people to assume this would work!

More important lesson to all.  No matter what backup process you choose.  Attempt a recovery from that process at least once before you need it.  This way if there is some unknown issue with the process you've chosen, you can deal with it before it is too late.  This is true of anything important enough to back up, not just bitcoin wallets.

Glad to hear that you found a good backup!
legendary
Activity: 2506
Merit: 1010
March 03, 2013, 09:28:08 PM
#14
SOLVED.

I found a wallet backup

\O/ 

+1 for multiple backups using multiple media (e.g., one kept locally like on a flash drive, and one backed up online somewhere like Dropbox (perhaps encrypted using TrueCrypt, even with Bitcoin-Qt's passsphrase encryption)
newbie
Activity: 22
Merit: 0
March 03, 2013, 07:34:25 PM
#13
SOLVED.

I found a wallet backup from before I "backed it up properly" in excel.  Nearly &!$%ed my pants when I found it.

Lesson to all - do not trust embedding files into Excel.  Granted I am one of the few foolish people to assume this would work!

Thanks to everyone - particularly Stephen Gornick.  I'll say it again - I love this place!
newbie
Activity: 22
Merit: 0
March 03, 2013, 05:47:48 PM
#12
Thanks so much for the continued help.  Here is where I am at now:

A) I've been storing my wallet backups as an embedded object in Microsoft Excel.  I've determined that this does not work.  I've tested this - I take a wallet that can be pywallet'd, embed it as an object in Excel, then copy it out of Excel, and suddenly pywallet complains.  Anyone have an idea how to circumvent this - this would by far be the easiest solution!
B) Trying to recover my Virtualbox VDI drive.  This is a long shot

Clearly I screwed up assuming backing it up in a spreadsheet (that gets backed up automaritally daily).  Lesson learned.

Any ideas?
legendary
Activity: 1512
Merit: 1036
March 02, 2013, 08:44:32 PM
#11
In bash on Xnix, you should quote the password with single quotes like --password='this!is!my!password'
legendary
Activity: 2506
Merit: 1010
March 02, 2013, 08:08:38 PM
#10
Running the -salvagewallet argument has the same result on my new linux QT client as well.  ie, the client quickly loads and closes without a peep.  It does not appear to attempt creating a backup wallet file that I can see.

If pywallet can't read it and salvage wallet can't even load it ... that's not good.  You don't have any older backups?  If you had backup media (e.g., flash drive) have you re-tried re-copying from the media with both pywallet and then -salvagewallet  (i.e, not used the same wallet.dat after one failed and then trying the next?)

The last ditch approach might have worked except that it only works for non-encrypted backups:
 - https://bitcointalksearch.org/topic/bitcoin-private-keywalletdat-data-recovery-tool-25091

But the number one lesson about backups ... if your backup can't be used to recover the database, then you have no backup.
newbie
Activity: 22
Merit: 0
March 02, 2013, 05:11:24 PM
#9
I think the "\" switch might work to get past #2.  But am stuck on point #1:

Code:
username@Ubuntu64-1204-BC:~/.bitcoin$ pyw --dumpwallet --password="ab\!\c"
ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again.
username@Ubuntu64-1204-BC:~/.bitcoin$
newbie
Activity: 22
Merit: 0
March 02, 2013, 05:07:28 PM
#8
Thanks.  I am now using the joric pywallet.

I've got two problems.  Both of these problems occur on both the jackjack and joric wallet:
1) I am getting an error when running it:  "ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again."
2) When I try to use the "--password" option, I am getting an error, I think because I have an exclamation point in my password.  I realize the jackjack pywallet doesnt accept the password option, but this also happens on the joric one.  Is there a linux switch (i've tried using \'s) that would allow the syntax?  I am fearful even if I get over this step, I'll be stuck on #1.  An example of this error (assuming my password is "ab!c" is below.  Any guidance please?

=========
Code:
username@Ubuntu64-1204-BC:~/.bitcoin$ ~/pywallet.py --dumpwallet --password="ab!c"
bash: !c": event not found
username@Ubuntu64-1204-BC:~/.bitcoin$
legendary
Activity: 2506
Merit: 1010
March 02, 2013, 03:13:30 PM
#7
But when I try to run it on my backed-up, encrypted file, it doesnt work.  Have tried the "--password" option that I saw somewhere but that appears not to be an option.

Since your wallet.dat is encrypted, you must use the version of pywallet that supports the -password switch.

 - https://github.com/joric/pywallet
newbie
Activity: 22
Merit: 0
March 02, 2013, 02:30:40 PM
#6
I've gotten to a point where I can run pywallet on a new unencrypted wallet.dat file.  But when I try to run it on my backed-up, encrypted file, it doesnt work.  Have tried the "--password" option that I saw somewhere but that appears not to be an option.

Any help recovering keys/fixing an encrypted wallet using pywallet?
newbie
Activity: 22
Merit: 0
March 02, 2013, 01:41:32 PM
#5
Nice tip.  I had not see the salvagewallet option.  You can also use pywallet to fix your wallet or recover your keys.

Thanks for tip jsCoin.  I am finding it tough to figure out how to use pywallet, but will press ahead until I am completely stuck before bothering you again.

Thanks.
newbie
Activity: 22
Merit: 0
March 02, 2013, 01:31:12 PM
#4
4) is there a way to read my private keys off of the "corrupted" wallet.dat?

What you can do is try to salvage the wallet.

Run Bitcoin-Qt manually from the command line and do a -salvagewallet

That moves the bad wallet.dat to wallet.timestamp.bak, then runs a 'salvage' operation to get key/value pairs, and writes them to a new wallet.dat.  Then the client continues from there.  If there was keys in corrupted data that it couldn't recover, those won't be in the new replacement wallet, but if it was able to salvage everything you won't be missing anything.


Thanks for the quick response.  I have tried that on my "new" windows QT client, and the QT just quits out.  No error, but no progress.

So I decided to install a new Ubuntu VM, to see maybe its a Linux/Windows compatibility issue, or if maybe the salvage only works on Linux.

Running the -salvagewallet argument has the same result on my new linux QT client as well.  ie, the client quickly loads and closes without a peep.  It does not appear to attempt creating a backup wallet file that I can see.

I would appreciate any more ideas you or anyone else may have.
newbie
Activity: 32
Merit: 0
March 02, 2013, 03:34:11 AM
#3
Nice tip.  I had not see the salvagewallet option.  You can also use pywallet to fix your wallet or recover your keys.
legendary
Activity: 2506
Merit: 1010
March 02, 2013, 12:04:13 AM
#2
4) is there a way to read my private keys off of the "corrupted" wallet.dat?

Sometimes when the Bitcoin-Qt client has the wallet open there are crucial pieces of data held in logfiles.  When the client shuts down, that process properly closes the wallet.dat and the file has data integrity.   If the client crashes or has some problem shutting down, the wallet won't have been closed properly.  Normally when that happens the client can be restarted and the data from the log files will be used to recover (rollback) the wallet or clean up, with not even a hiccup noticed by the user.  If you grabbed a copy of the wallet.dat while it was not in a closed state or was in need of recovery, then now when it tries to perform that recovery the needed log data is not accessible.

That may be what happened, or perhaps there was a media error with the backup, or the wallet.dat was already corrupt but the client didn't notice (the more recent releases are more stringent about checking validity) or any number of explanations for why currently the wallet.dat is unreadable.

What you can do is try to salvage the wallet.

Run Bitcoin-Qt manually from the command line and do a -salvagewallet

That moves the bad wallet.dat to wallet.timestamp.bak, then runs a 'salvage' operation to get key/value pairs, and writes them to a new wallet.dat.  Then the client continues from there.  If there was keys in corrupted data that it couldn't recover, those won't be in the new replacement wallet, but if it was able to salvage everything you won't be missing anything.

newbie
Activity: 22
Merit: 0
March 01, 2013, 11:07:33 PM
#1
Hi,
Clearly a newbie here.  My situation is I had a Ubuntu virtual machine with my bitcoin-qt client on it.  I backed up the wallet, I do not recall how I backed it up (using "backup" from the menu or just copying the file, I dont recall).

The VM has crashed, unrecoverable.

No biggy I was thinking.  So I have installed the QT client on a windows pc now.  Ran the QT client for a minute, then exited to get my backed-up wallet installed.  Copied the file in, renamed it wallet.dat.  Starting the QT client.  it complained "wallet.dat corrupt, salvage failed".

Is this not supposed to work?  few questions:
1) are linux wallet.dat files compatible in windows
2) do I need to wait for the entire blockchain to load before putting the wallet in?  I wouldnt think so.
3) for my own edification, I have another windows QT client that has the vast majority of my QT coins.  Is there ANY danger in taking that wallet.dat file (from windows machine A) and putting it into my new QT client (on windows machine B).  
4) is there a way to read my private keys off of the "corrupted" wallet.dat?
5) if I do manage to read my private keys off of the "corrupted" wallet, how can I get them into a client (ideally QT client)
6) What is the correct way to import a backed-up wallet?  I'm assuming just copy it into that directory.

Apologies in advance, but I am a noob.

ps love this place.
Jump to: