<p>This was a learning experience for me too! I wasn't sure how to extract keys on Windows, and had to work my way through it. This is what I did on Windows 7.</p>

<p>Before you do anything: <strong>backup your wallet!</strong></p>

<p>Bitcoin-Qt does not have these as commands in it's GUI, so you need to use bitcoind.</p>

<ol>
<li><p>Close Bitcoin-Qt</p></li>
<li><p>Open Command Prompt</p></li>
<li><p>Enter the command:</p>

<p><code>"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" -server</code></p>

<p>or if that doesn't work, try 
<code>"C:\Program Files\Bitcoin\daemon\bitcoind" -server</code></p>

<p>(The <code>-server</code> switch tells bitcoind to accept commands.)</p>

<p>That CMD session should freeze and become unresponsive--just minimise it; that's Window's way of telling you it's working.</p></li>
<li><p>Open another Command Prompt and type: </p>

<p><code>"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" dumpprivkey [ADDRESS]</code></p>

<p>Where address is the full public address.</p>

<p>So, I might enter <code>"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" dumpprivkey 18gcVuGVgJSPswQML7LbxQBFEmBgrEwtuW</code></p>

<p>Do this for every address you have bitcoin(s) in or want to keep.</p></li>
<li><p>Write down all of your private keys. </p></li>
<li><p>Close both CMD's, delete your wallet (<strong>not the backup</strong>), and redo steps 2 and 3. (This will create a new wallet for you to use.)</p></li>
<li><p>Enter <code>"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" importprivkey [PRIVATE KEY] [LABEL]</code> into the 2nd CMD instance.</p>

<p>So for example <code>"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" importprivkey 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ OldWallet</code></p></li>
</ol>

CC BY-SA 3.0
2014-04-05T00:54:53.697Z
I have looked at the instructions and I get this error when trying to get my keys "CDB() : can't open database file wallet.dat, error -30974 (code -1)
steelmythos
CC BY-SA 3.0
2014-04-05T01:04:28.333Z
@steelmythos By "when trying to get your keys" do you mean when running the `dumpprivkey` command? Or something else?
KJ O
CC BY-SA 3.0
2014-04-05T01:18:41.837Z
what i mean is i am using the console under the help menu option. I had to restart bitcoin client to get to the private keys.
steelmythos
CC BY-SA 3.0
2014-04-05T01:20:21.267Z
@steelmythos no problem! If you found my answer fulfilled your question, please consider marking your question as answered so other people with the same problem may find help in the future. And may I be the first to say: **Welcome to SE!**
KJ O
CC BY-SA 3.0
2014-04-05T01:37:13.077Z
It started working. i followed your instructions but got stuck. But i noticed that the Maxcoin was installed in the same dir. I renamed the maxcoin install restarted bitcoin and i was able to send 2 coins I will test further in a couple hours. but right now it looks good. thanks agin i could not have done it without you
steelmythos
CC BY-SA 3.0
2014-04-05T01:39:20.113Z
@steelmythos That's what the site is for! :) Enjoy your stay.
KJ O
CC BY-SA 3.0
2014-04-04T23:19:16.700Z
2014-04-04T23:32:22.283Z
2014-04-04T23:32:22.283Z
KJ O
<p>I get this error when I try to send BTC</p>

<p>A FATAL ERROR OCCURRED. Bitcoin can no longer continue safely and will quit.</p>

<p>Exception: St13runtime_error</p>

<p>CDB(): can’t open database file wallet.dat, error -30974</p>

<p>C:\program files (x86)\Bitcoin\bitcoin-qt.exe in Runaway exception</p>

<p>Win 7
Bit core 0.9.0</p>

<p>Any help would be greatly appreciated</p>

<p>Thanks</p>

CC BY-SA 3.0
2014-04-04T22:11:56.127Z
Sounds like your wallet is corrupted. Try extracting your keys, and reïmporting them.
KJ O
CC BY-SA 3.0
2014-04-04T22:25:41.263Z
I am a newbie so if there instructions on how to perform a key extraction and re-importation that would be great thx
steelmythos
<wallet><bitcoin-core>
my wallet will not send BTC
steelmythos
# my wallet will not send BTC

(Asked by: username_0 on 2014-04-04)

I get this error when I try to send BTC

A FATAL ERROR OCCURRED. Bitcoin can no longer continue safely and will quit.

Exception: St13runtime\_error

CDB(): can’t open database file wallet.dat, error -30974

C:\program files (x86)\Bitcoin\bitcoin-qt.exe in Runaway exception

Win 7
Bit core 0.9.0

Any help would be greatly appreciated

Thanks

**Tags:** wallet, bitcoin-core

> **Comments:**
> **username_1**: Sounds like your wallet is corrupted. Try extracting your keys, and reïmporting them.  
> **username_0**: I am a newbie so if there instructions on how to perform a key extraction and re-importation that would be great thx  

---

## 1 answers

### Answer by username_1 on 2014-04-04. Score: 1 | Accepted answer

This was a learning experience for me too! I wasn't sure how to extract keys on Windows, and had to work my way through it. This is what I did on Windows 7.

Before you do anything: **backup your wallet!**

Bitcoin-Qt does not have these as commands in it's GUI, so you need to use bitcoind.

1. Close Bitcoin-Qt
2. Open Command Prompt
3. Enter the command:

   `"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" -server`

   or if that doesn't work, try
   `"C:\Program Files\Bitcoin\daemon\bitcoind" -server`

   (The `-server` switch tells bitcoind to accept commands.)

   That CMD session should freeze and become unresponsive--just minimise it; that's Window's way of telling you it's working.
4. Open another Command Prompt and type:

   `"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" dumpprivkey [ADDRESS]`

   Where address is the full public address.

   So, I might enter `"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" dumpprivkey 18gcVuGVgJSPswQML7LbxQBFEmBgrEwtuW`

   Do this for every address you have bitcoin(s) in or want to keep.
5. Write down all of your private keys.
6. Close both CMD's, delete your wallet (**not the backup**), and redo steps 2 and 3. (This will create a new wallet for you to use.)
7. Enter `"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" importprivkey [PRIVATE KEY] [LABEL]` into the 2nd CMD instance.

   So for example `"C:\Program Files (x86)\Bitcoin\daemon\bitcoind" importprivkey 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ OldWallet`

> **Comments:**
> **username_0**: I have looked at the instructions and I get this error when trying to get my keys "CDB() : can't open database file wallet.dat, error -30974 (code -1)  
> **username_1**: @username_0 By "when trying to get your keys" do you mean when running the `dumpprivkey` command? Or something else?  
> **username_0**: what i mean is i am using the console under the help menu option. I had to restart bitcoin client to get to the private keys.  
> **username_1**: @username_0 no problem! If you found my answer fulfilled your question, please consider marking your question as answered so other people with the same problem may find help in the future. And may I be the first to say: **Welcome to SE!**  
> **username_0**: It started working. i followed your instructions but got stuck. But i noticed that the Maxcoin was installed in the same dir. I renamed the maxcoin install restarted bitcoin and i was able to send 2 coins I will test further in a couple hours. but right now it looks good. thanks agin i could not have done it without you  
> **username_1**: @username_0 That's what the site is for! :) Enjoy your stay.  

---

