<p>First, close the Bitcoin-Qt client.</p>
<p>Then you have to locate <a href="https://en.bitcoin.it/wiki/Data_directory#Default_Location" rel="noreferrer">your Bitcoin folder.</a> For Windows, it should be here:</p>
<p><code>%APPDATA%\Bitcoin</code></p>
<p>and for Linux:</p>
<p><code>~/.bitcoin</code></p>
<p>In that folder, there should be a <code>wallet.dat</code> file.</p>
<ul>
<li>If you currently have no bitcoins in your wallet, you can just delete that file and replace it with your backup.</li>
<li>If you have some bitcoins in this wallet as well, backup that wallet file as well, or send all the coins to an address from your backed up wallet.</li>
</ul>
<p>When you placed the other <code>wallet.dat</code> file in place, you should run Bitcoin-Qt with the <code>-rescan</code> option. Here's how to do that in Windows:</p>
<ul>
<li><p>Go to <code>C:\Program Files (x86)\Bitcoin</code> using Windows Explorer.</p>
</li>
<li><p>In that folder, hold shift and right-click and select <code>Open command window here</code> (<a href="https://i.sstatic.net/ZkcwZ.jpg" rel="noreferrer">picture</a>).</p>
</li>
<li><p>In the command prompt, type <code>bitcoin-qt.exe -rescan</code> and hit enter (<a href="https://i.sstatic.net/YTnkT.jpg" rel="noreferrer">picture</a>).</p>
</li>
</ul>
<p>Now Bitcoin-Qt should start and rescan the blockchain to calculate the balances of the addresses in your <code>wallet.dat</code> file.</p>
<p>(Source for pictures: <a href="https://bitcoin.stackexchange.com/questions/7731/cant-see-bitcoin-after-restore-of-backup#comment10112_7734">cant see bitcoin after restore of backup</a>)</p>

CC BY-SA 3.0
2015-05-03T08:27:43.277Z
What do you mean, "localize your Bitcoin folder." ?
Jonathan David Finch
CC BY-SA 3.0
2015-05-09T23:15:27.473Z
@JonathanDavidFinch I mean find the folder that contains your Bitcoin data files
Steven Roose
CC BY-SA 3.0
2015-07-01T13:49:53.353Z
What happens if I backed up two separate wallets to two separate .dat files?
jakc
CC BY-SA 3.0
2015-08-04T10:11:43.860Z
That's more difficult. What I would do is import one of them, generate a new address and copy it. Then back up the wallet.dat file and import the other one. From there send all coins to the copied address from the first wallet file. Finally just continue using the first wallet file. (Keep the second one for a few days for the case that something went wrong ;))
Steven Roose
CC BY-SA 3.0
2017-05-24T06:19:39.353Z
You can also use the command-line option `-wallet otherwallet.dat` to use an alternative wallet (in the data directory) without copying/moving over the existing one, this can be useful for juggling wallets with less risk.
laanwj
CC BY-SA 3.0
2017-05-24T06:23:19.437Z
For help on finding the data directory on other operating systems, see https://en.bitcoin.it/wiki/Data_directory  (might make sense to add this to the answer)
laanwj
CC BY-SA 4.0
2018-11-19T14:53:30.740Z
@StevenRoose dude! I just randomly found your post trying to restore a wallet! What a small world!

I'm the dude from Madrid that contacted you through the Dartcoin project, we got beers and a burguer remember? lol
Dani
CC BY-SA 4.0
2019-03-30T18:04:13.473Z
I can't believe an answer would start with "just delete that file" regardless of the "if".  NEVER "just delete" a wallet.dat file.
user5652
CC BY-SA 4.0
2013-05-16T12:16:51.880Z
2021-01-06T11:38:26.967Z
2021-01-06T11:38:26.967Z
Steven Roose
<p>For OSX:</p>

<ol>
<li>Backup your original wallet.dat file (<code>~/Library/Application Support/Bitcoin/wallet.dat</code> by default). This contains the private keys for your bitcoins. If you lose it, you lose your coins.</li>
<li>Install Bitcoin Core on a machine with 100s of gigabytes of free space. Allow it to download the blockchain. This could take days.</li>
<li>Replace the <code>wallet.dat</code> file on the new machine with your old one.</li>
<li>Start Bitcoin Core on the new machine with the <code>rescan</code> flag, to scan the blockchain for your newly imported bitcoin. You can do this with the command line <code>/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -rescan</code>. This can also take a long time (hours).</li>
<li>Your wallet should now be imported and working on the new computer.</li>
</ol>

CC BY-SA 3.0
2017-12-06T02:13:05.710Z
2017-12-06T02:13:05.710Z
Adam Millerchip
<p>the other answers suggest closing your node copying directories etc, NOT necessary. Here is how i did it starting with an old <code>wallet2.dat</code> file:</p>

<ol>
<li>create a folder <code>foo</code> (any name, any directory)</li>
<li>copy the file wallet2.dat into folder <code>foo</code> and rename the wallet to <code>wallet.dat</code></li>
<li>on the GUI click Window->Console and type into the > field: <code>help loadwallet</code> which will tell you bunch of stuff (you can read it, or skip to next point)</li>
<li>type <code>loadwallet /path/to/your/folder/foo</code> (change it to your actual path where folder foo is, on windows eg <code>C:\Users\user\Downloads\foo</code>)</li>
<li><p>wait, just wait (for me 30min), when done you will see sth like:</p>

<p>{
  "name": "/home/user/Downloads/foo/",
  "warning": ""
}</p></li>
<li><p>got to File->Open Wallet -> <code>foo</code> (your name should be listed here)</p></li>
<li><p>On the right side there is now a dropdown menu where you can selected your open wallets (if it does not appear you had no other wallet open, also ok)</p></li>
</ol>

<p><a href="https://i.sstatic.net/LI2cK.png" rel="noreferrer"><img src="https://i.sstatic.net/LI2cK.png" alt="enter image description here"></a></p>

<p>(Since the wallet is now located in the folder foo and outside the datadir, you might want to close your node and copy the folder into the <code>wallets</code> directory in your datadir; I just wanted to recover the wallet, clean it and send the funds to the default wallet deleting foo anyway)</p>

CC BY-SA 4.0
2020-08-06T07:29:56.067Z
i added the folder in bitcoindata\wallets\wallet1 etc. somehow bitcoin core detected all wallets automatically
wutzebaer
CC BY-SA 4.0
2021-03-03T04:19:29.957Z
this seems to require a full blockchain. I tried this with a pruned node and it gives error: 
"Wallet loading failed. Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node) (code -4)"
pseudozach
CC BY-SA 4.0
2019-06-26T14:21:57.593Z
2019-06-26T14:21:57.593Z
droid192
<p>I think the above answer is good, but I have typically restored a few times with </p>

<pre><code>1. ShutDown BitCoin Client
2. Find your wallet location  (%APPDATA%\Bitcoin)   OR for example :  C:\Users\UserName\AppData\Roaming\Bitcoin
3. Backup, verify, then delete that wallet.dat file 
4. Paste your other wallet.dat file into the folder.
5. Open BitCoin Client  , blocks get checked and updated, and you should see your amount.
6. I'm not sure that you need to do command prompt with the -rescan...   I didn't have to..
</code></pre>

CC BY-SA 3.0
2017-12-06T23:46:57.073Z
Not sure that asking a user to delete the wallet is a good idea. I would back it up in case you get mixed up.
Vallieres
CC BY-SA 3.0
2017-12-12T08:44:13.817Z
good point, added into #1   thx
Tom Stickel
CC BY-SA 3.0
2014-05-22T03:12:40.357Z
2017-12-24T04:57:46.313Z
2017-12-24T04:57:46.313Z
Tom Stickel
<p>I had Bitcoin-Qt on my computer with several bitcoins in my wallet, using Vista. Then my computer crashed.  Finally I was able to get my computer fixed and download a new version of Bitcoin-Qt.  Now I would like to import my original <code>wallet.dat</code> from the old client which was encrypted into an new version of Bitcoin-Qt.  How do I do that?  </p>

<bitcoin-core><wallet-import>
Import wallet.dat into a new Bitcoin-Qt client
Doug
# Import wallet.dat into a new Bitcoin-Qt client

(Asked by: username_0 on 2013-05-16)

I had Bitcoin-Qt on my computer with several bitcoins in my wallet, using Vista. Then my computer crashed. Finally I was able to get my computer fixed and download a new version of Bitcoin-Qt. Now I would like to import my original `wallet.dat` from the old client which was encrypted into an new version of Bitcoin-Qt. How do I do that?

**Tags:** bitcoin-core, wallet-import


---

## 4 answers

### Answer by username_1 on 2013-05-16. Score: 43

First, close the Bitcoin-Qt client.

Then you have to locate [your Bitcoin folder.](https://en.bitcoin.it/wiki/Data_directory#Default_Location) For Windows, it should be here:

`%APPDATA%\Bitcoin`

and for Linux:

`~/.bitcoin`

In that folder, there should be a `wallet.dat` file.

* If you currently have no bitcoins in your wallet, you can just delete that file and replace it with your backup.
* If you have some bitcoins in this wallet as well, backup that wallet file as well, or send all the coins to an address from your backed up wallet.

When you placed the other `wallet.dat` file in place, you should run Bitcoin-Qt with the `-rescan` option. Here's how to do that in Windows:

* Go to `C:\Program Files (x86)\Bitcoin` using Windows Explorer.
* In that folder, hold shift and right-click and select `Open command window here` ([picture](https://i.sstatic.net/ZkcwZ.jpg)).
* In the command prompt, type `bitcoin-qt.exe -rescan` and hit enter ([picture](https://i.sstatic.net/YTnkT.jpg)).

Now Bitcoin-Qt should start and rescan the blockchain to calculate the balances of the addresses in your `wallet.dat` file.

(Source for pictures: [cant see bitcoin after restore of backup](https://bitcoin.stackexchange.com/questions/7731/cant-see-bitcoin-after-restore-of-backup#comment10112_7734))

> **Comments:**
> **username_2**: What do you mean, "localize your Bitcoin folder." ?  
> **username_1**: @username_2 I mean find the folder that contains your Bitcoin data files  
> **username_3**: What happens if I backed up two separate wallets to two separate .dat files?  
> **username_1**: That's more difficult. What I would do is import one of them, generate a new address and copy it. Then back up the wallet.dat file and import the other one. From there send all coins to the copied address from the first wallet file. Finally just continue using the first wallet file. (Keep the second one for a few days for the case that something went wrong ;))  
> **username_4**: You can also use the command-line option `-wallet otherwallet.dat` to use an alternative wallet (in the data directory) without copying/moving over the existing one, this can be useful for juggling wallets with less risk.  
> **username_4**: For help on finding the data directory on other operating systems, see https://en.bitcoin.it/wiki/Data_directory  (might make sense to add this to the answer)  
> **username_5**: @username_1 dude! I just randomly found your post trying to restore a wallet! What a small world!  I'm the dude from Madrid that contacted you through the Dartcoin project, we got beers and a burguer remember? lol  
> **username_6**: I can't believe an answer would start with "just delete that file" regardless of the "if".  NEVER "just delete" a wallet.dat file.  

---

### Answer by username_7 on 2017-12-06. Score: 7

For OSX:

1. Backup your original wallet.dat file (`~/Library/Application Support/Bitcoin/wallet.dat` by default). This contains the private keys for your bitcoins. If you lose it, you lose your coins.
2. Install Bitcoin Core on a machine with 100s of gigabytes of free space. Allow it to download the blockchain. This could take days.
3. Replace the `wallet.dat` file on the new machine with your old one.
4. Start Bitcoin Core on the new machine with the `rescan` flag, to scan the blockchain for your newly imported bitcoin. You can do this with the command line `/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -rescan`. This can also take a long time (hours).
5. Your wallet should now be imported and working on the new computer.


---

### Answer by username_8 on 2019-06-26. Score: 6

the other answers suggest closing your node copying directories etc, NOT necessary. Here is how i did it starting with an old `wallet2.dat` file:

1. create a folder `foo` (any name, any directory)
2. copy the file wallet2.dat into folder `foo` and rename the wallet to `wallet.dat`
3. on the GUI click Window->Console and type into the > field: `help loadwallet` which will tell you bunch of stuff (you can read it, or skip to next point)
4. type `loadwallet /path/to/your/folder/foo` (change it to your actual path where folder foo is, on windows eg `C:\Users\user\Downloads\foo`)
5. wait, just wait (for me 30min), when done you will see sth like:

   {
   "name": "/home/user/Downloads/foo/",
   "warning": ""
   }
6. got to File->Open Wallet -> `foo` (your name should be listed here)
7. On the right side there is now a dropdown menu where you can selected your open wallets (if it does not appear you had no other wallet open, also ok)

[![enter image description here](https://i.sstatic.net/LI2cK.png)](https://i.sstatic.net/LI2cK.png)

(Since the wallet is now located in the folder foo and outside the datadir, you might want to close your node and copy the folder into the `wallets` directory in your datadir; I just wanted to recover the wallet, clean it and send the funds to the default wallet deleting foo anyway)

> **Comments:**
> **username_9**: i added the folder in bitcoindata\wallets\wallet1 etc. somehow bitcoin core detected all wallets automatically  
> **username_10**: this seems to require a full blockchain. I tried this with a pruned node and it gives error:  "Wallet loading failed. Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node) (code -4)"  

---

### Answer by username_11 on 2014-05-22. Score: 0

I think the above answer is good, but I have typically restored a few times with

```
1. ShutDown BitCoin Client
2. Find your wallet location  (%APPDATA%\Bitcoin)   OR for example :  C:\Users\UserName\AppData\Roaming\Bitcoin
3. Backup, verify, then delete that wallet.dat file 
4. Paste your other wallet.dat file into the folder.
5. Open BitCoin Client  , blocks get checked and updated, and you should see your amount.
6. I'm not sure that you need to do command prompt with the -rescan...   I didn't have to..

```

> **Comments:**
> **username_12**: Not sure that asking a user to delete the wallet is a good idea. I would back it up in case you get mixed up.  
> **username_11**: good point, added into #1   thx  

---

