Bitcoin Forum
May 12, 2024, 07:07:46 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 »  All
  Print  
Author Topic: Corrupted wallet.dat  (Read 711 times)
nc50lc
Legendary
*
Online Online

Activity: 2408
Merit: 5598


Self-proclaimed Genius


View Profile
May 25, 2023, 03:38:03 PM
Last edit: December 15, 2023, 11:52:47 AM by nc50lc
 #41

I have just checked & Bitcoin Core is still the same, I have looked in open wallet & it's blank/greyed out, no wallets are available.
A sole 'wallet.dat' file inside wallets folder should be automatically loaded as "default wallet" once Bitcoin Core is started.
(update note: this is not applicable to the later versions.)
Since it's in the 'wallets' folder, it should also be available in the Open wallet menu.
So it seems like there's an issue with your restored wallet.dat file.

Can you try to load it via "File->Restore..."?
Close Bitcoin Core, move your wallet.dat file somewhere else, Open Bitcoin Core and use that restore menu
then in the file explorer that popped-up, browse to the location of the wallet.dat file and select it.
If it loaded, a new wallet file will be created with the same keys from your wallet file; if not, it's corrupted and you should use salvage as I've instructed.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
1715497666
Hero Member
*
Offline Offline

Posts: 1715497666

View Profile Personal Message (Offline)

Ignore
1715497666
Reply with quote  #2

1715497666
Report to moderator
The block chain is the main innovation of Bitcoin. It is the first distributed timestamping system.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 25, 2023, 04:05:22 PM
 #42

Thanks, yes I restarted the Bitcoin Core program & it's the same.
I'll try the 'restore' option later this evening, I will have to check back in the thread for the instructions to do this task.
whanau
Member
**
Offline Offline

Activity: 116
Merit: 30


View Profile
May 25, 2023, 07:14:15 PM
 #43

I am surprised that the wallet.dat file isn't seen

nc50lc has provided good advice ..
A sole 'wallet.dat' file inside wallets folder should be automatically loaded as "default wallet" once Bitcoin Core is started.

i would just add to check that in C:\Users\MyUserName\Appdata\Roaming\Bitcoin there are the following files in the wallets folder

wallet.dat
walletlock
db.log
and a folder called database

As you use windows walletlock may have an extension or be hidden.
Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 25, 2023, 08:26:34 PM
Last edit: May 25, 2023, 08:52:41 PM by Tigerbill
 #44

I am surprised that the wallet.dat file isn't seen

nc50lc has provided good advice ..
A sole 'wallet.dat' file inside wallets folder should be automatically loaded as "default wallet" once Bitcoin Core is started.

i would just add to check that in C:\Users\MyUserName\Appdata\Roaming\Bitcoin there are the following files in the wallets folder

wallet.dat
walletlock
db.log
and a folder called database

As you use windows walletlock may have an extension or be hidden.


In C:\Users\MyUserName\Appdata\Roaming\Bitcoin I have the following files.

blocks
chainstate
wallet (with my wallet.dat inside)
.lock
anchors.dat
banlist.json
debug
fee_estimates.dat
mempool.dat
peers.dat
settings.json

These files are not present in the wallet folder:
walletlock
db.log
and a folder called database


I really appreciate everything you have done to help thus far.

Cheers.
whanau
Member
**
Offline Offline

Activity: 116
Merit: 30


View Profile
May 25, 2023, 09:23:58 PM
 #45

A bit strange. Huh Seems like bitcoin core is not picking up the wallet file
Out of interest, is the wallet file encrypted?

wallet.dat is all lowercase, no spaces windows hasn't named it wallet.dat.dat or something weird??

For good measure I would shut down bitcoin core and reboot windows (power down)
Then open bitcoin core again. If you end up with the same greyed out wallet option then follow nc50lc's advice.

If that advice doesn't work more drastic measures may be necessary. I have my own recovery software which I do not wish to make public.
Assuming your wallet is encrypted, so safe, If all else fails and you want me to try my software then send me a pm.

Good luck
Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 25, 2023, 09:31:28 PM
Last edit: May 25, 2023, 10:43:01 PM by Tigerbill
 #46

I do have these from the original deleted but recovered wallet folder:
database folder
.walletlock
db
wallet.dat

I think I did encrypt the wallet but not entirely sure & is called wallet.dat, I didn't rename it.

I'll try the restore method soon.

Thanks again.

Just to see what happened I tried the 'restore' option from the wallet file I copied onto my D: drive & pointed Bitcoin Core to that file, typed in the wallet name & received a message saying Restore wallet failed.
Wallet file verification failed to load database C:\Users\MyUserName\Appdata\Roaming\Bitcoin\wallets\My wallet
Data is not in recognised format.

Next I will try the 'repair' option.
Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 25, 2023, 10:53:13 PM
Last edit: May 26, 2023, 12:28:30 AM by Tigerbill
 #47

Since it's quite buried in the first page, I'll quote my post here for reference:
(plus additional comments since it looks like you're new in using commands)
If the recovered file is corrupted, try to use salvage command of Bitcoin Core's bitcoin-wallet tool:
  • Go to Bitcoin Core's install directory, open "bin" folder;
    Since you're on Windows, it's in "C:\Program Files\Bitcoin\bin" folder by default.
    -> that is only the default, if you've installed Bitcoin Core in different directory, browse to that directory instead.
    And inside that folder, there should be a bitcoin-wallet file inside it which is the tool that you're going to use.
  • Open your command prompt and cd to that directory, enter: cd "C:\Program Files\Bitcoin\bin"
    -> this is important since this will change command prompt's working directory where bitcoin-wallet.exe tool is located, in this case, inside "bin" folder.
    Of course, as stated above, if Bitcoin Core is installed to a different directory, cd to its 'bin' folder instead.
  • Then to use salvage command with bitcoin-wallet tool: bitcoin-wallet --wallet="full path to your wallet.dat" salvage
    For example: if your corrupted wallet.dat is saved in "D:\testdir\wallet.dat", it should be --wallet="D:\testdir\wallet.dat"
    -> To create the example, create a temporary folder in "D:", name it "testdir" and paste your corrupted wallet.dat in it.
    That's only for the example, you can use any folder that you want and make sure to enter its path in "--wallet=<path>" arg.
  • Command should finish without any response, otherwise, there's an error.
  • If it finished without errors, load the wallet.dat to Bitcoin Core and see if it's now fixed.
    -> If there's no error, go to your "testdir" where the corrupted wallet.dat is, if salvage command is successful, there should be a backup file there named "wallet.dat.nnnnnnn.bak"
    which is the original corrupted wallet.dat.
    In that case, open Bitcoin Core and use the menu: "File->Restore Wallet", browse to that "testdir" directory and open wallet.dat.
    Bitcoin Core will try to restore that salvaged wallet, and if there's no issue, it should load and rescan.
[/quote]

Hi, this is where I am lost, I cannot seem to locate the 'bin' file in the install directory in Program Files on C:
Is the 'bin' file created after making a new wallet?, currently I have no wallets loaded.

In C:Program Files/Bitcoin I have:
deamon folder
share folder
bitcoin.conf
bitcoin.qt
COPYING
readme
uninstall

In the daemon folder I have:
bitcoin-cli
bitcoind
bitcoin-tx
bitcoin-wallet
test_bitcoin

Thanks.
whanau
Member
**
Offline Offline

Activity: 116
Merit: 30


View Profile
May 26, 2023, 12:29:09 AM
Last edit: May 26, 2023, 12:43:49 AM by whanau
 #48

You wrote:

In the daemon folder I have:
bitcoin-cli
bitcoind
bitcoin-tx
bitcoin-wallet  *** is the executable file
^^^So, its in the daemon folder. ,^^ as nc50lc says:-

Then to use salvage command with bitcoin-wallet tool: bitcoin-wallet --wallet="full path to your wallet.dat" salvage
For example: if your corrupted wallet.dat is saved in "D:\testdir\wallet.dat", it should be --wallet="D:\testdir\wallet.dat"

test_bitcoin



I do have these from the original deleted but recovered wallet folder:
database folder
.walletlock
db
wallet.dat

No harm sticking them in the C:\Users\MyUserName\Appdata\Roaming\Bitcoin\wallets folder and see what happens.. Shut down bitcoin core first.

Do you know you can always make another empty wallet for testing from the files menu in bitcoin core??
You could do that and paste the above in that folder  overwriting what was just created.

good luck

Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 26, 2023, 01:08:03 AM
 #49

Thanks for the quick reply & I have tried your idea to copy all the files into the wallet from my recovered files, unfortunately there are still no wallets to load.

I have tried the command prompt cd "C:\Program Files\Bitcoin\bin" & got this error 'the system cannot find the file specified'
whanau
Member
**
Offline Offline

Activity: 116
Merit: 30


View Profile
May 26, 2023, 01:17:50 AM
 #50

forget bin for now
cd "C:\Program Files\Bitcoin\bitcoin-wallet if bitcoin-wallet is a folder otherwise
cd "C:\Program Files\Bitcoin
then run
bitcoin-wallet --wallet="full path to your wallet.dat" salvage

I hope you know the password if the wallet is encrypted otherwise we are wasting our time.
DON'T Publish it! Grin
Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 26, 2023, 01:21:32 AM
Last edit: May 26, 2023, 01:33:03 AM by Tigerbill
 #51

Gotcha & it's amazing that I actually thought to try that & it came up with this error 'the system cannot find the file specified'
I did retry the  command again from your text cd "C:\Program Files\Bitcoin\bitcoin-wallet but the same error comes up & I also tried the command prompt in admin mode but the same error 'the system cannot find the file specified'

At least I do know the password  Smiley

If I can get this wallet back online, I will treat both of you for taking the time out to help me like this.
whanau
Member
**
Offline Offline

Activity: 116
Merit: 30


View Profile
May 26, 2023, 01:37:30 AM
 #52

OK I suspect the path to your wallet may be wrong try this

copy your wallet to

"C:\Program Files\Bitcoin\bitcoin-wallet" assuming bitcoin-wallet is a folder.
If its a program then just

"C:\Program Files\Bitcoin\
and copy your wallet there. Then run

bitcoin-wallet --wallet=wallet.dat salvage

no "" around wallet.dat
Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 26, 2023, 01:47:00 AM
 #53

OK I suspect the path to your wallet may be wrong try this

copy your wallet to

"C:\Program Files\Bitcoin\
and copy your wallet there. Then run

bitcoin-wallet --wallet=wallet.dat salvage

no "" around wallet.dat

I confirm bitcoin-wallet is a program for me, so I copied the wallet folder with all my recovered files to the main Bitcoin directory in Program Files, I used command prompt without admin rights, typed: bitcoin-wallet --wallet=wallet.dat salvage

Received this error: 'bitcoin-wallet' is not a recognised as an internal or external command.

If I try to run the bitcoin-wallet program, it just disappears in a flash.
whanau
Member
**
Offline Offline

Activity: 116
Merit: 30


View Profile
May 26, 2023, 01:52:24 AM
 #54

I think that is a windows oddity

try with quotation marks around the lot. sometimes windows doesn't like spaces..

 "bitcoin-wallet --wallet=wallet.dat salvage"

then
 "bitcoin-wallet.exe --wallet=wallet.dat salvage"
Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 26, 2023, 01:56:07 AM
 #55

I tried this in command prompt with Bitcoin Core open & closed & got the same error.

 "bitcoin-wallet --wallet=wallet.dat salvage" is not a recognised as an internal or external command, operable program or batch file.

"bitcoin-wallet.exe --wallet=wallet.dat salvage" is not a recognised as an internal or external command, operable program or batch file.

This is unreal, nothing seems to work the way it should.
whanau
Member
**
Offline Offline

Activity: 116
Merit: 30


View Profile
May 26, 2023, 01:59:41 AM
 #56

I think I am out of ideas.

try just running bitcoin-wallet.exe
see what it says
then bitcoin-wallet --wallet
see what it says should be no wallet file or similar
Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 26, 2023, 02:03:07 AM
Last edit: May 26, 2023, 02:18:00 AM by Tigerbill
 #57

I think I am out of ideas.

try just running bitcoin-wallet.exe
see what it says
then bitcoin-wallet --wallet
see what it says should be no wallet file or similar

Damn it, I just don't understand why the command prompts are not functioning.  Huh
I have opened the Bitcoin QT & there are no wallets available, I will leave it on overnight again.

When I try to run the bitcoin-wallet exe in the daemon folder, it disappears before I can see anything.

Almost forgot to say thank you for being here.
whanau
Member
**
Offline Offline

Activity: 116
Merit: 30


View Profile
May 26, 2023, 02:34:19 AM
 #58

You are running the command prompt/ powershell as an administrator??
Tigerbill (OP)
Jr. Member
*
Offline Offline

Activity: 62
Merit: 1


View Profile
May 26, 2023, 02:46:41 AM
 #59

You are running the command prompt/ powershell as an administrator??

I have used all of the versions of commands as administrator & then normally without admin rights.

I notice you mention Powershell, I am using command prompt in Windows 10 Pro.
nc50lc
Legendary
*
Online Online

Activity: 2408
Merit: 5598


Self-proclaimed Genius


View Profile
May 26, 2023, 02:59:37 AM
 #60

Hi, this is where I am lost, I cannot seem to locate the 'bin' file in the install directory in Program Files on C:
Is the 'bin' file created after making a new wallet?, currently I have no wallets loaded.

In C:Program Files/Bitcoin I have:
deamon folder
share folder
bitcoin.conf
bitcoin.qt
COPYING
readme
uninstall

In the daemon folder I have:
bitcoin-cli
bitcoind
bitcoin-tx
bitcoin-wallet
test_bitcoin

Thanks.
I've mentioned twice already, there's no "bin file".
It's the folder where bitcoin-wallet is located and the directory where you should use "cd" (change directory) in command prompt.
Please check my previous replies in this thread since I've already addressed most of these concerns and separate whanau's replies with mine.

To answer this shortly: it's your old installation since there's a "daemon" folder, which is equivalent to the "bin" folder of the new version.
And in your reply, there's a "bitcoin-wallet" file inside it; which is what you need to perform salvage. (if the version is too old, it may not contain the salvage command)

The workflow is this simple (without repeating the already given instructions):
  • Find Bitcoin Core's installation directory (where you installed Bitcoin Core), not the 'bitcoin' data directory in your 'appdata/roaming' folder.
  • Open cmd and cd to the directory above. The trailing "C:\Users\YOUR_USERNAME>" in command prompt will change into that directory after entering the cd command.
  • Use the provided salvage command.
  • Load the salvaged wallet to Bitcoin Core.

Take note that salvage's success still depends if the keys/master key in your wallet.dat are still intact.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pages: « 1 2 [3] 4 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!