<p>Your wallet.dat hold the keys.  If the client is intermittently seeing errors you will not want to continue using it.  </p>

<p>You essentially want to create a new, empty wallet and then import the keys into the new wallet.</p>

<p>One approach is to use Blockchain.info/wallet which can <a href="https://blockchain.info/wallet/import-wallet" rel="nofollow">import the wallet.dat</a>, and then you can export the keys from their web interface.</p>

<p>If that doesn't work, then you can try running the client (with no blockchain data files and no network connectivity) and from the Debug console export (dump) the private keys.</p>

<p>Another approach is to use joric's pywallet tool to export the keys.</p>

CC BY-SA 3.0
2016-08-03T17:07:55.357Z
you save my life! thanks ! the 2 command to rescue this issue are:
1. dumpprivkey
2 . importprivkey
temple
CC BY-SA 3.0
2013-03-11T10:12:53.080Z
2013-03-11T10:12:53.080Z
Stephen Gornick
<p>I have ~5 BTC on an old laptop (Windows 7) and I tried moving the balance to another client. At first I tried moving about 0.1 BTC just to see what would happen. The client debitted the balance but it never "took" (that is, I never received the 0.1 BTC, and I know it is a good address). The client informed me I should update immediately so I updated to the latest version (v 0.8.0). The client would not load the wallet so I googled around and found a solution that said try to move all the files out of this directory EXCEPT for wallet.dat:</p>

<p>c:\Users[Me]\AppData\Roaming\Bitcoin</p>

<p>I made a copy of this folder elsewhere and emptied all the files except for wallet.dat, and I am now downloading the blockchain. However, intermittently I get this error:</p>

<pre><code>System error: CDB(): can't open database file wallet.dat, error -30974
</code></pre>

<p>The error is thrown by this part of bitcoin's code.</p>

<pre><code>ret = pdb-&gt;open(NULL,      // Txn pointer
                        fMockDb ? NULL : pszFile,   // Filename
                        fMockDb ? pszFile : "main", // Logical db name
                        DB_BTREE,  // Database type
                        nFlags,    // Flags
                        0);
// snip 7 lines
throw runtime_error(strprintf("CDB() : can't open database file %s, error %d", pszFile, ret));
</code></pre>

<p>Which causes the client to close. Right now I am simply re-opening bitcoin, where it will run for awhile (download a maybe a few hundred blocks or so) and then close again. </p>

<p>So the current issues are:<br>
1. The 0.1 BTC I mentioned above is still showing as being debited from the total inside the local bitcoin client though there is no receipt at the receiving address, and this is confirmed by blockchain.info<br>
 2. I cannot create a new address to send coins<br>
 3. The client will not load the blockchain without indicating the error above and closing</p>

CC BY-SA 3.0
2013-03-10T15:50:26.827Z
Could it be permission related?
Colin Dean
<bitcoin-core><wallet.dat>
technical question: receiving wallet.dat error
Chris
# technical question: receiving wallet.dat error

(Asked by: username_0 on 2013-03-09)

I have ~5 BTC on an old laptop (Windows 7) and I tried moving the balance to another client. At first I tried moving about 0.1 BTC just to see what would happen. The client debitted the balance but it never "took" (that is, I never received the 0.1 BTC, and I know it is a good address). The client informed me I should update immediately so I updated to the latest version (v 0.8.0). The client would not load the wallet so I googled around and found a solution that said try to move all the files out of this directory EXCEPT for wallet.dat:

c:\Users[Me]\AppData\Roaming\Bitcoin

I made a copy of this folder elsewhere and emptied all the files except for wallet.dat, and I am now downloading the blockchain. However, intermittently I get this error:

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

```

The error is thrown by this part of bitcoin's code.

```
ret = pdb->open(NULL,      // Txn pointer
                        fMockDb ? NULL : pszFile,   // Filename
                        fMockDb ? pszFile : "main", // Logical db name
                        DB_BTREE,  // Database type
                        nFlags,    // Flags
                        0);
// snip 7 lines
throw runtime_error(strprintf("CDB() : can't open database file %s, error %d", pszFile, ret));

```

Which causes the client to close. Right now I am simply re-opening bitcoin, where it will run for awhile (download a maybe a few hundred blocks or so) and then close again.

So the current issues are:  
1. The 0.1 BTC I mentioned above is still showing as being debited from the total inside the local bitcoin client though there is no receipt at the receiving address, and this is confirmed by blockchain.info  
2. I cannot create a new address to send coins  
3. The client will not load the blockchain without indicating the error above and closing

**Tags:** bitcoin-core, wallet.dat

> **Comments:**
> **username_1**: Could it be permission related?  

---

## 1 answers

### Answer by username_2 on 2013-03-11. Score: 4

Your wallet.dat hold the keys. If the client is intermittently seeing errors you will not want to continue using it.

You essentially want to create a new, empty wallet and then import the keys into the new wallet.

One approach is to use Blockchain.info/wallet which can [import the wallet.dat](https://blockchain.info/wallet/import-wallet), and then you can export the keys from their web interface.

If that doesn't work, then you can try running the client (with no blockchain data files and no network connectivity) and from the Debug console export (dump) the private keys.

Another approach is to use joric's pywallet tool to export the keys.

> **Comments:**
> **username_3**: you save my life! thanks ! the 2 command to rescue this issue are: 1. dumpprivkey 2 . importprivkey  

---

