Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: JungleOnion on September 17, 2017, 06:11:57 AM



Title: Corrupted wallet.dat file - attempt to recover
Post by: JungleOnion on September 17, 2017, 06:11:57 AM
Hey so this is for an altcoin wallet, I'm not sure if this is the right technical support forum to ask this, but because the wallet is based in the bitcoin core wallet I think this inquiry could fit this forum.

Anyway, I made a mistake and deleted the appdata folder for my wallet, when I noticed the mistake I quickly pressed ctrl+z to undo the deleting and the folder came back to the appdata folder, but the wallet client was open meanwhile, so when the files got restored, for some reason the wallet tried to repopulate the files were missing by creating new ones and I think it override the wallet.dat private keys or something. I created the wallet on august 31st 2017, deposited on september 1st, and this happened in september 9th I believe. After this fuck up on september 9th, the wallet address changed, but the wallet.dat still show it was created on august 31st so I think the wallet.dat is corrupted and I saw in the command line that there's this command "-salvage" which the description says its used to attempt to recover corrupted wallet.dat files.

How can I use this command to fix my wallet?

All files I have in the appdata folder are the ones I created in august 31st.


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: bl0ckchayn on September 17, 2017, 06:54:28 PM
did you lose your coins and no longer see them in the wallet? some of the bitcoin based altcoin wallets create backups of the wallet file each time they are launched look in the data folder for a backups folder if you have that then you could try using one of the .dat files in there

also, many people have had success with the pywallet tool for recovering the wallet private keys from a corrupt .dat so you could try that:
https://github.com/jackjack-jj/pywallet



Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: morbius55 on September 17, 2017, 07:35:12 PM
did you lose your coins and no longer see them in the wallet? some of the bitcoin based altcoin wallets create backups of the wallet file each time they are launched look in the data folder for a backups folder if you have that then you could try using one of the .dat files in there

also, many people have had success with the pywallet tool for recovering the wallet private keys from a corrupt .dat so you could try that:
https://github.com/jackjack-jj/pywallet


Pywallet doesn't seem to work anymore, I can't even download it (access denied)?


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: JungleOnion on September 17, 2017, 09:55:02 PM
did you lose your coins and no longer see them in the wallet? some of the bitcoin based altcoin wallets create backups of the wallet file each time they are launched look in the data folder for a backups folder if you have that then you could try using one of the .dat files in there

also, many people have had success with the pywallet tool for recovering the wallet private keys from a corrupt .dat so you could try that:
https://github.com/jackjack-jj/pywallet



No this one didn't have automatic backups sadly :( I'll research more about this tool thanks for the info! Hope I can figure it out.


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: JungleOnion on September 17, 2017, 09:55:42 PM
did you lose your coins and no longer see them in the wallet? some of the bitcoin based altcoin wallets create backups of the wallet file each time they are launched look in the data folder for a backups folder if you have that then you could try using one of the .dat files in there

also, many people have had success with the pywallet tool for recovering the wallet private keys from a corrupt .dat so you could try that:
https://github.com/jackjack-jj/pywallet


Pywallet doesn't seem to work anymore, I can't even download it (access denied)?

hey I went to the link bl0ckchayn shared and I downloaded without problems.


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: cissrawk on September 18, 2017, 09:19:52 AM
I saw in the command line that there's this command "-salvage" which the description says its used to attempt to recover corrupted wallet.dat files.

How can I use this command to fix my wallet?
first copy or backup your wallet.dat to safe place from your wallet.dat folder (for safety) , after that use cmd and go to directly to your bitcoin-qt.exe and add "-salvagewallet"
example :
Code:
D:\>cd walletfolder
D:\walletfolder>cd bin
D:\walletfolder\bin>wallet.exe -salvagewallet
change to your wallet destination and wallet name like bitcoin-qt.exe or etc.

edit: i notice is not bitcoin wallet so i change a little bit, but if you say based on bitcoin core so maybe same with it.


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: kazzzidy on September 19, 2017, 10:04:43 AM
I saw in the command line that there's this command "-salvage" which the description says its used to attempt to recover corrupted wallet.dat files.

How can I use this command to fix my wallet?
first copy or backup your wallet.dat to safe place from your wallet.dat folder (for safety) , after that use cmd and go to directly to your bitcoin-qt.exe and add "-salvagewallet"
example :
Code:
D:\>cd walletfolder
D:\walletfolder>cd bin
D:\walletfolder\bin>wallet.exe -salvagewallet
change to your wallet destination and wallet name like bitcoin-qt.exe or etc.

edit: i notice is not bitcoin wallet so i change a little bit, but if you say based on bitcoin core so maybe same with it.

what does salvagewallet do? Does it delete the old wallet or restore it in the folder?


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: HCP on September 19, 2017, 01:09:44 PM
It attempts to dump all the private keys it can detect (including false positives) from your wallet.dat... it isn't a magic bullet that will magically resurrect a corrupt or damaged wallet.dat and should only be used as a last resort and only on a copy of the file.

Apparently, there have been instances in the past where salvagewallet has actually corrupted a valid wallet file...


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: JungleOnion on September 20, 2017, 05:49:35 AM
I saw in the command line that there's this command "-salvage" which the description says its used to attempt to recover corrupted wallet.dat files.

How can I use this command to fix my wallet?
first copy or backup your wallet.dat to safe place from your wallet.dat folder (for safety) , after that use cmd and go to directly to your bitcoin-qt.exe and add "-salvagewallet"
example :
Code:
D:\>cd walletfolder
D:\walletfolder>cd bin
D:\walletfolder\bin>wallet.exe -salvagewallet
change to your wallet destination and wallet name like bitcoin-qt.exe or etc.

edit: i notice is not bitcoin wallet so i change a little bit, but if you say based on bitcoin core so maybe same with it.

Hey thanks for the help, I'll try and see how it goes. I'm going to try everything I can to recover that wallet! :o


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: JungleOnion on September 20, 2017, 06:01:42 AM
So nothing I got an error saying
"wallet.dat corrupt, salvage failed"
 
After I did the salvage in cmd it pop out asking me how I wanted to open the file, because I couldn't find how to open it I opened it in a notepad and then save it as a wallet.dat, opened it in the folder and got that message. Did I do something wrong?


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: cissrawk on September 20, 2017, 07:14:43 AM
So nothing I got an error saying
"wallet.dat corrupt, salvage failed"
 
After I did the salvage in cmd it pop out asking me how I wanted to open the file, because I couldn't find how to open it I opened it in a notepad and then save it as a wallet.dat, opened it in the folder and got that message. Did I do something wrong?

Never got that before, maybe you can try use pywallet or this method https://bitcointalk.org/index.php?topic=22697.0


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: jackg on September 20, 2017, 10:58:07 PM
So nothing I got an error saying
"wallet.dat corrupt, salvage failed"
 
After I did the salvage in cmd it pop out asking me how I wanted to open the file, because I couldn't find how to open it I opened it in a notepad and then save it as a wallet.dat, opened it in the folder and got that message. Did I do something wrong?

That may be your problem, don't use notepad to save the wallet.dat file. There are four different types of file you can save from notepad and getting the encoding wrong on that is going to cause troubles with salvagewallet.

As and addition to what cissrawk posted, go to github.com/jackjack-jj/pywallet to download pywallet (jackjack is a user here also).


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: JungleOnion on September 24, 2017, 08:32:40 PM
thanks guys, I'm still trying to figure out all this, I'm encourage to recover that wallet!


Title: Re: Corrupted wallet.dat file - attempt to recover
Post by: jackg on September 24, 2017, 10:22:10 PM
thanks guys, I'm still trying to figure out all this, I'm encourage to recover that wallet!

Did you attempt pywallet, did it work or fail?
It normally works a bit better than the regular salvagewallet command does.