43

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?

37

First, close the Bitcoin-Qt client.

Then you have to locate your Bitcoin folder. For Windows, it should be here:

%APPDATA%\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).

  • In the command prompt, type bitcoin-qt.exe -rescan and hit enter (picture).

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)

  • 1
    What do you mean, "localize your Bitcoin folder." ? – Jonathan David Finch May 3 '15 at 8:27
  • @JonathanDavidFinch I mean find the folder that contains your Bitcoin data files – Steven Roose May 9 '15 at 23:15
  • What happens if I backed up two separate wallets to two separate .dat files? – Simon Jul 1 '15 at 13:49
  • 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 Aug 4 '15 at 10:11
  • 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. – wumpus May 24 '17 at 6:19
2

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.
2

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

(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)

  • This answer is much better than the accepted answer, thank you. – Jonah Jul 21 at 20:51
-1

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..
  • 1
    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 Dec 6 '17 at 23:46
  • good point, added into #1 thx – Tom Stickel Dec 12 '17 at 8:44

protected by Community Jan 10 '18 at 21:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.