I now get ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again.
In which case it sounds like the path to the wallet file might be incorrect... where exactly are the recovered_wallet.dat files located? and what are their exact names? For some reason i have db.001 to db.006 showing as separate files when i go to downloads. But i also have a folder i created in downloads that i named pywallet. The pywallet folder contains those same db files and also the recovered wallet.dats. Don't know why they are duplicated separately. Could that be messing up the path? Each db file is the same size as the ones in the pywallet folder.The name of the wallet file is the same as you wrote and is within the pywallet folder along with others i recovered.
|
|
|
bsddb.db.DBNoSuchFileError: <2, 'No such file or directory -- C:\\Users\\Catherine\\Appdata\\Roaming\\Bitcoin\\__db.001: No such file or directory'>
As mentioned earlier... use the command that has the --datadir=. option in it if you get "no such file or directory __db.001" C:\Python27\python.exe pywallet.py --dumpwallet --datadir=. --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat
I now get ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again.
|
|
|
bsddb.db.DBNoSuchFileError: <2, 'No such file or directory -- C:\\Users\\Catherine\\Appdata\\Roaming\\Bitcoin\\__db.001: No such file or directory'>
As mentioned earlier... use the command that has the --datadir=. option in it if you get "no such file or directory __db.001" C:\Python27\python.exe pywallet.py --dumpwallet --datadir=. --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat
Thanks again, will try when I get in from work tomorrow.
|
|
|
"I missed your other question, sorry about that". No problem, I appreciate any help and sorry I'm such a noob with all this stuff.
|
|
|
I missed your other question, sorry about that. Within Downloads I have a file called pywallet containing the recovered wallet dats, a file called python-2.7.11 installer package, another called pywallet.bat and another called pywallet.py.
Try changing to the Downloads folder using cd C:/Users/Catherine/Downloads and then run the command that HCP posted just now.
Thanks for the reply. Do I need to include the recovery part of this command as the wallets are already recovered from the hard drive (a separate one in a caddy)? I only need to dump the already recovered_wallets_number.dats that are already in a folder I named pywallet? Thanks. No you can skip that part and just do the dumping that we're trying to help you get done. I got Traceback <most recent call last>: File "pywallet.py", line 5004, in <module> db_env = create_env<db_dir File "pywallet.py" line 1269, in create_env r = db_env.open<db_dir, <DB_CREATE:DB_INIT_LOCK:DB_INIT_LOG:MPOOL:DB_ INIT_TXN:DB_THREAD:DB_RECOVER>> bsddb.db.DBNoSuchFileError: <2, 'No such file or directory -- C:\\Users\\Catherine\\Appdata\\Roaming\\Bitcoin\\__db.001: No such file or directory'>
|
|
|
Within Downloads I have a file called pywallet containing the recovered wallet dats, a file called python-2.7.11 installer package, another called pywallet.bat and another called pywallet.py.
|
|
|
where is your pywallet.py file? Does the folder "C:\Users\Catherine\Downloads\pywallet\" exist? If it does exist, does your command prompt say: C:\Users\Catherine\Downloads\pywallet\>
Yes, minus the backslash after pywallet.
|
|
|
The easiest way is to just leave off the --passphrase option... if you don't include it, and the wallet.dat has a passphrase, it won't be able to show the private keys For instance: C:\Python27\python.exe pywallet.py --dumpwallet --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat
Also, if you get a "No such file or directory" error about there not being a __db.001 file... you will need a --datadir, so the command would be: C:\Python27\python.exe pywallet.py --dumpwallet --datadir=. --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat
Once you're ready to output with the private keys displayed, just remember to add the --passphrase option back I'm now getting C:\Python27\python.exe: can't open file 'pywallet.py' : Errno 2 No such file or directory.
|
|
|
Just before i dump out (possibly) the private keys. What is the command line for just dumping the wallet dat still encrypted? When I ran multiple recoveries, I added more than one passphrase when It asked. So some wallet dats are larger than others. Does this mean there is more than one wallet in the larger files with more than one passphrase. Not sure how that works. Cheers.
|
|
|
OK, let's take another look at this... To dump out the wallet INCLUDING your private keys to the screen ONLY: pywallet.py --dumpwallet --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat --passphrase="YOUR-PASS-PHRASE"
To dump out the wallet INCLUDING your private keys to a text file: pywallet.py --dumpwallet --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat --passphrase="YOUR-PASS-PHRASE" > C:\Users\Catherine\Dowloads\pywallet\walletDump-withKeys.txt
When trying to dump wallet with private keys to a text file i keep getting a syntax error message I copied the command line shown Thanks if you can help me get it running. Can you please be more specific about the syntax error message that you were getting when you trying copying the command lines that I recommended earlier? Are you able to copy/paste them from the terminal window? It's difficult to know what the actual solution is, when the actual problem is not well defined Thanks for replying and sorry for the delayed response. So I typed cmd into search box and hit enter, bringing up command console. This starts with C:\Users> and then i typed the first command line you provided for a screen dump straight after that with no spaces and included the quote marks around the passphrase. This returned, 'pywallet.py' is not recognized as an internal or external command, operable program or batch file. This is on a windows 7 computer and I am keeping it offline. Thanks for your time.
|
|
|
My amateur opinion is that the wallet is encrypted, so you need to add the passphrase for it in the script.
|
|
|
Can anyone help me dump the already pywallet recovered wallet files out to text. I used the original version with Python 2.7. Thanks.
|
|
|
Hi and thanks for the reply. What would be helpful is if you gave me a command line to try based on pywallet being the folder where the recovered wallets are, and pywallet.py being in a separate folder, and both being in Users\name\Downloads
We will use the commands that HCP wrote earlier in this thread but slightly modify it for our new PyWallet and recovered wallets directory path. Blue is my modifications to the commands which apply to your present scenario (I hope he doesn't mind). ...
It involves getting a small USB stick (preferably 1GB)... wipe it clean (delete everything off it, format it etc) and putting just your "corrupted" wallet.dat on it. Then you have to manually run the pywallet command from the commandline to get it to scan your corrupted wallet.dat and try and recover private keys.
Assuming you had a 1GB USB stick and it was showing on windows as D: and you "extracted" PyWallet to "C:\Users\name\Downloads\the\path\to\PyWallet" (when running the PWI_0.0.3.exe): Step 1. you would put (a copy) of your corrupted wallet.dat on the USB stick Step 2. Start -> Run, Type cmd and press enter Step 3. cd C:\Users\name\Downloads\the\path\to\PyWallet Step 4. python pywallet.py --recover --recov_device=D: --recov_size=1Gio --recov_outputdir=C:\Users\name\Downloads\path\to\RecoveredWalletsFolder > C:\Users\name\Downloads\pywallet-output.txt
If your USB stick is larger, change 1Gio to what Gigabytes it is... 8GB = 8Gio, 16GB = 16Gio... if you use a stick larger than 1GB, be prepared to wait a LONG time while pywallet scans it.
This will make the screen output completely silent, instead redirecting everything to your pywallet-output.txt file. Then, open the pywallet-output.txt file generated in the Downloads folder to see the screen output of PyWallet. Thanks for the reply. Do I need to include the recovery part of this command as the wallets are already recovered from the hard drive (a separate one in a caddy)? I only need to dump the already recovered_wallets_number.dats that are already in a folder I named pywallet? Thanks.
|
|
|
So I started this thread quite a while ago and was able to recover some wallet.dats by running pywallet. They are all in a folder I named pywallet which is in the Downloads folder and all have the usual timestamp numbers to them. pywallet.py is also in Downloads but a different folder. My problem is that I can't dump any of the wallets, even though I saw the keys and headings etc being generated on screen during recovery, for each of the wallet.dats I recovered. I used the last pywallet before the more recent alterations with Python 2.7 and I am on a Windows 7 Pro computer. I don't know if the command line I am trying is wrong because I keep getting syntax or pywallet.py not recognised or dumpwallet not recognised errors. I really need to dump these wallet.dats so I can go through them and look for valid addresses/private keys. The recovered wallets were tried in Bitcoin core and wouldn't work, so need to try it this way. Thanks, if anyone can help.
Is is possible for you to post the stack trace that appears for some of these errors: For example this is a "mock" exception that I made up and want you to look for ones that are printed in this format: In foo.py, line 13: a = string[i+1] IndexError: Requested index out of range Now it doesn't have to specifically be IndexError, I am interested in any log on the screen that prevents pywallet from working. Meanwhile since you can see the private keys are on your screen, you can "capture" the screen output to a file by typing at the end of the command "> screen_output.txt". Try adding it at the end of the dumpwallet command and see if you get any private keys into the file. Hi and thanks for the reply. What would be helpful is if you gave me a command line to try based on pywallet being the folder where the recovered wallets are, and pywallet.py being in a separate folder, and both being in Users\name\Downloads The recovered wallet dats each have a timestamp number. when i ran the recoveries the found keys scroll through the screen and are not visible once the process is done, well apart from maybe the last 2. I think this is designed that way, and you can't scroll back up to look at the rest or take a screen shot. I could do with the command line for dumping specific wallet dats so I can check addresses and another for adding passphrase to show decrypted private keys based on the file locations mentioned. I'm assuming I would use open command window here, ie in downloads. Please excuse my amateurish computer skills. Thanks.
|
|
|
So I started this thread quite a while ago and was able to recover some wallet.dats by running pywallet. They are all in a folder I named pywallet which is in the Downloads folder and all have the usual timestamp numbers to them. pywallet.py is also in Downloads but a different folder. My problem is that I can't dump any of the wallets, even though I saw the keys and headings etc being generated on screen during recovery, for each of the wallet.dats I recovered. I used the last pywallet before the more recent alterations with Python 2.7 and I am on a Windows 7 Pro computer. I don't know if the command line I am trying is wrong because I keep getting syntax or pywallet.py not recognised or dumpwallet not recognised errors. I really need to dump these wallet.dats so I can go through them and look for valid addresses/private keys. The recovered wallets were tried in Bitcoin core and wouldn't work, so need to try it this way. Thanks, if anyone can help.
|
|
|
Do you mean old version of Python, pywallet or both? Anyway, it's better to create new thread rather than hijacking this thread. Both. It is my thread.
|
|
|
I'm not even sure you CAN load the recovered .dat file into Bitcoin Core... Pywallet is quite old... and doesn't really work with newer wallet files... so I doubt that the wallet files that it generates will work with newer versions unless you upgrade the wallet file, or run Bitcoin Core in the legacy "non-HD" mode. First, make several copies of the recovered wallet .dat, to save you having to run the pywallet --recover again if anything goes wrong. - Then make sure that Bitcoin Core is not running - Then put one copy of the recovered wallet .dat into the Bitcoin Core Data Directory and rename it "wallet.dat" - Start Bitcoin Core with the -upgradewallet command If that doesn't work... try starting Bitcoin Core with -usehd=0 command If both of those fail, then you're going to have to try and extract the private keys from the recovered wallet dat and import them into a wallet manually. To achieve that, your best option is to probably to use the pywallet "dumpwallet" command... with the recovered_wallet_1511377727.dat file... and just dump the whole thing out to a text file. If you give it the wallet passphrase that you selected when you did the "recovery", it will also include the private keys To check that the command is working OK and pywallet can dump the wallet: pywallet.py --dumpwallet --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat
To dump the wallet out to a text file, with private keys encrypted (so you can check the addresses): pywallet.py --dumpwallet --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat > C:\Users\Catherine\Downloads\pywallet\walletDump-NoKeys.txt
At this point, you should find a "walletDump-NoKeys.txt" file in "C:\Users\Catherine\Dowloads\pywallet" that you can open with a text editor... you should be able to see all the addresses that have been "recovered". I would suggest searching through these to see if you can find addresses that hold coins (input the addresses on a block explorer like www.blockchain.info). To dump out the wallet INCLUDING your private keys to the screen ONLY: pywallet.py --dumpwallet --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat --passphrase="YOUR-PASS-PHRASE"
To dump out the wallet INCLUDING your private keys to a text file: pywallet.py --dumpwallet --wallet=C:\Users\Catherine\Downloads\pywallet\recovered_wallet_1511377727.dat --passphrase="YOUR-PASS-PHRASE" > C:\Users\Catherine\Dowloads\pywallet\walletDump-withKeys.txt
You should find a "walletDump-withKeys.txt" in the "C:\Users\Catherine\Dowloads\pywallet" that you can open with a text editor... all your "recovered" addresses and private keys should be visible... the private keys are the ones labelled "sec". Import the private keys, that match the addresses that have coins, into the wallet of your choice. When trying to dump wallet with private keys to a text file i keep getting a syntax error message I copied the command line shown Thanks if you can help me get it running.
|
|
|
Why didn't you just use pywallet to scan the drive from the start? Was there an advantage to using your program first?.
I don't think that pywallet can do a low-level scan of the harddisk, it expects a wallet.dat file. And Python would be very slow anyway compared to my C program. Would love to try it but I would need some detailed noob instructions. I have a 500 gig drive that had 32 BTC on it, so you see why I would want to give it a try . Merry Xmas to you.
|
|
|
Why didn't you just use pywallet to scan the drive from the start? Was there an advantage to using your program first?.
|
|
|
|