<p>Yes.  However, you will lose any new private keys in the current wallet.dat.  Even if you didn't create any new addresses, bitcoin-qt creates change addresses if you send any money.  So, to be safe, you should dump the private keys for your current wallet.dat and the stop bitcoin-qt.  Replace the current wallet.dat with the saved wallet.dat.  Restart bitcoin-qt and then dump the private keys again.  If you have the same set, all is well.  Otherwise, you will need to import any missing private keys.</p>

<p>To dump the private keys using the bitcoin-qt debug console:</p>

<ol>
<li>listaddressgroupings</li>
<li>walletpassphrase your-passphrase 300</li>
<li>dumpprivkey bitcoin-address</li>
<li>walletlock</li>
</ol>

<p>Step 1 will list the bitcoin addresses in your wallet.  Steps 2 and 4 are only needed if the wallet is encrypted and unlocks your wallet for a maximum of 300 seconds.  Repeat Step 3 for each bitcoin address.</p>

<p>To import a private key using the bitcoin-qt debug console:</p>

<ol>
<li>walletpassphrase your-passphrase 300</li>
<li>importprivkey private-key "key-label"</li>
<li>walletlock</li>
</ol>

<p>Steps 1 and 3 are only needed if the wallet is encrypted.  Repeat Step 2 for each private key you are importing.  The key-label is whatever you want to identify the key.</p>

CC BY-SA 3.0
2013-12-10T22:40:10.923Z
2013-12-10T22:40:10.923Z
ScripterRon
<p>I need to restore a wallet created with bitcoin-qt which was encrypted.  I have the encrypted wallet.dat file only.  Do I restore this simply by replacing the current wallet.dat with my backup wallet.dat file?</p>

<bitcoin-core><backup><encryption><wallet-recovery>
Restore encrypted wallet
oshirowanen
# Restore encrypted wallet

(Asked by: username_0 on 2013-12-10)

I need to restore a wallet created with bitcoin-qt which was encrypted. I have the encrypted wallet.dat file only. Do I restore this simply by replacing the current wallet.dat with my backup wallet.dat file?

**Tags:** bitcoin-core, backup, encryption, wallet-recovery


---

## 1 answers

### Answer by username_1 on 2013-12-10. Score: 2 | Accepted answer

Yes. However, you will lose any new private keys in the current wallet.dat. Even if you didn't create any new addresses, bitcoin-qt creates change addresses if you send any money. So, to be safe, you should dump the private keys for your current wallet.dat and the stop bitcoin-qt. Replace the current wallet.dat with the saved wallet.dat. Restart bitcoin-qt and then dump the private keys again. If you have the same set, all is well. Otherwise, you will need to import any missing private keys.

To dump the private keys using the bitcoin-qt debug console:

1. listaddressgroupings
2. walletpassphrase your-passphrase 300
3. dumpprivkey bitcoin-address
4. walletlock

Step 1 will list the bitcoin addresses in your wallet. Steps 2 and 4 are only needed if the wallet is encrypted and unlocks your wallet for a maximum of 300 seconds. Repeat Step 3 for each bitcoin address.

To import a private key using the bitcoin-qt debug console:

1. walletpassphrase your-passphrase 300
2. importprivkey private-key "key-label"
3. walletlock

Steps 1 and 3 are only needed if the wallet is encrypted. Repeat Step 2 for each private key you are importing. The key-label is whatever you want to identify the key.


---

