<p>You can <a href="http://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments" rel="nofollow">configure</a> Bitcoin QT to use a specific <a href="http://en.bitcoin.it/wiki/Data_directory" rel="nofollow">data directory</a>, but it only looks in that place for <code>wallet.dat</code>.  </p>

<p>I would (1) close Bitcoin QT, (2) move the existing <code>[data directory]\wallet.dat</code> to another folder (3) copy your backup into the <code>[data directory]</code>, and (4) reopen Bitcoin QT. </p>

<p>Don't overwrite your existing <code>wallet.dat</code> with the backup!  Step (2) is pretty important in case there's a problem with the backup file.</p>

CC BY-SA 3.0
2014-02-26T18:28:17.013Z
This sounds easier than renaming the whole directory. Any idea of how I can do that for an Android/iOS client?
user
CC BY-SA 3.0
2014-02-26T19:21:56.947Z
I'm not sure, sorry.
Robert Claypool
CC BY-SA 3.0
2014-02-26T18:20:20.280Z
2014-02-26T18:20:20.280Z
Robert Claypool
<p>NEVER play around and fiddle with a working software/wallet for testing backups. Because you can make a mistake. Expert computer users destroy data regularly by mistakes in backups. And when you some time actually need a backup is the worst time for fiddling around, so better have a solution already prepared.</p>

<p>To verify the "account balance" on your wallet you'd need to either download the blockchain (but the pruned version is enough if you're not hardcore paranoid) and need to know which bitcoin addresses you control (="your bitcoins"). Or just look up your addresses on bitcoin.info or biteasy or other website that gives you a view onto the blockchain.
Actually it can be a good idea to continuously track your balance with a separate software. If you don't need to hide which bitcoins are yours, simply export a "watching only" wallet from your current software (it's a wallet without the keys needed to actually spend/transact/sign for your coins) and maybe import the watching wallet in some smartphone app or some web wallet, then set up some suitable notifications.</p>

<p>To simply verify the correctness of a wallet.dat, up to date tools may not exist. A 2011 forum thread about the original python wallet tools has a warning at the front: <a href="https://bitcointalk.org/index.php?topic=11331.0" rel="nofollow">https://bitcointalk.org/index.php?topic=11331.0</a>
And in another question, someone had lost their wallet.dat (or moved+renamed and forgot about it) and it appears the wallet file format is not easy to detect by anything other than the file name. So a wallet verification tool would depend on getting source code from the wallet software and knowing which file and encryption/password to verify it with.</p>

<p>If your backup is a "standard" wallet.dat file you have some(1) chance for it to work in many different wallet softwares and apps. Preferably test on a fresh computer that has never been connected to any network (i.e. installed without cables plugged in. Windows 95 could get hacked while the installation software was running the last phases...). Without an extra physical computer, try using a virtual machine-software and create a fresh "computer inside your computer".
If Linux doesn't scare you and your wallet software is available on linux, then you can create a USB-stick with linux on it. Linux Live USB can give you one that runs as a virtual machine, but classical Live USB sticks instead require you to restart your computer with the USB plugged in and might be tricky to get working.</p>

<p>Finally, if you load you wallet backup on an untrusted computer or even a smartphone, you should have prepared in advance a new safe wallet to send your coins to. </p>

<p>And you should NEVER keep a large amount of coins in such a way that it can all be lost or stolen if you get the phone/computer stolen or if you forget a password. Think how much USD/EUR/... cash you would carry with you on a street with risk for pickpockets, robberies, loosing your wallet by clumsiness, etc and use that as a guide for how much bitcoin you should be handling yourself. For bigger sums, first exercise with smaller sums and it is probably wise to spread your risk by using several trusted expert(2) third parties to store your coins, just like you use banks to handle savings accounts.
The time when all "banks" can be removed is not yet. Better, safer apps and hardware wallets need to be created.</p>

<p>(1) In <a href="http://media01.bitcoinarmory.com/InsideBitcoins_Present.pdf" rel="nofollow">http://media01.bitcoinarmory.com/InsideBitcoins_Present.pdf</a> it is explained that wallet encryption works differently in Bitcoin-Qt and Armory, and presumably other wallet software use a weaker but more "standard" wallet encryption.
(2) MtGox has proved again and again they are not experts. Most other well-known online wallets/traders are probably trustable with some bigger sums</p>

CC BY-SA 3.0
2014-02-27T06:08:04.443Z
I agree with all your points about safety but installing VM for testing wallets is too much effort IMHO. I was wondering if there's a tool that'll verify the wallet file integrity without jumping through hoops. And it's a good point to test any method with a wallet with a tiny amount.
user
CC BY-SA 3.0
2014-02-27T00:33:41.297Z
2014-02-27T10:26:58.533Z
2014-02-27T10:26:58.533Z
Simon B.
<p>Best method IMHO is to restore the wallet on another (trusty) device, check the balance, <strong>spend a little amount of uBTC</strong> and verify the other address got the money. Then delete securely the test wallet. A VM in this case is very handy.</p>

<p>The key step is to actually spend and test everything goes as expected. If you don't do it you can't never be 100% confident the backup will work</p>

<p>Checking you got the right balance back is not enough because the checking itself does not require the client to actually know the private key</p>

CC BY-SA 3.0
2016-07-16T15:38:27.033Z
2016-07-16T15:38:27.033Z
Gianluca Ghettini
<p>I follow the instructions for wallet backup and save them digitally. What's a convenient way to occasionally test my wallet backup. I want to make sure that I'm not doing something stupid &amp; my backup method isn't creating unrecoverable garbage. </p>

<p>I can think of 2 ways for testing  </p>

<ol>
<li>Install the bitcoin client on another computer and import the backup &amp; check balances</li>
<li>Rename my installed folder on the existing computer &amp; do a fresh install on the existing computer. </li>
</ol>

<p>But these methods are not very convenient. Is there a <strong>smarter</strong> way around it? e.g. a command line tool that'll check the file integrity and spit out some data with which you are reasonably confident that it's <strong>your</strong> wallet and has the right amount of coins.</p>

<bitcoin-core><wallet><client><backup>
How do I test my wallet backup?
user
# How do I test my wallet backup?

(Asked by: username_0 on 2014-02-26)

I follow the instructions for wallet backup and save them digitally. What's a convenient way to occasionally test my wallet backup. I want to make sure that I'm not doing something stupid & my backup method isn't creating unrecoverable garbage.

I can think of 2 ways for testing

1. Install the bitcoin client on another computer and import the backup & check balances
2. Rename my installed folder on the existing computer & do a fresh install on the existing computer.

But these methods are not very convenient. Is there a **smarter** way around it? e.g. a command line tool that'll check the file integrity and spit out some data with which you are reasonably confident that it's **your** wallet and has the right amount of coins.

**Tags:** bitcoin-core, wallet, client, backup


---

## 3 answers

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

You can [configure](http://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments) Bitcoin QT to use a specific [data directory](http://en.bitcoin.it/wiki/Data_directory), but it only looks in that place for `wallet.dat`.

I would (1) close Bitcoin QT, (2) move the existing `[data directory]\wallet.dat` to another folder (3) copy your backup into the `[data directory]`, and (4) reopen Bitcoin QT.

Don't overwrite your existing `wallet.dat` with the backup! Step (2) is pretty important in case there's a problem with the backup file.

> **Comments:**
> **username_0**: This sounds easier than renaming the whole directory. Any idea of how I can do that for an Android/iOS client?  
> **username_1**: I'm not sure, sorry.  

---

### Answer by username_2 on 2014-02-27. Score: 0

NEVER play around and fiddle with a working software/wallet for testing backups. Because you can make a mistake. Expert computer users destroy data regularly by mistakes in backups. And when you some time actually need a backup is the worst time for fiddling around, so better have a solution already prepared.

To verify the "account balance" on your wallet you'd need to either download the blockchain (but the pruned version is enough if you're not hardcore paranoid) and need to know which bitcoin addresses you control (="your bitcoins"). Or just look up your addresses on bitcoin.info or biteasy or other website that gives you a view onto the blockchain.
Actually it can be a good idea to continuously track your balance with a separate software. If you don't need to hide which bitcoins are yours, simply export a "watching only" wallet from your current software (it's a wallet without the keys needed to actually spend/transact/sign for your coins) and maybe import the watching wallet in some smartphone app or some web wallet, then set up some suitable notifications.

To simply verify the correctness of a wallet.dat, up to date tools may not exist. A 2011 forum thread about the original python wallet tools has a warning at the front: <https://bitcointalk.org/index.php?topic=11331.0>
And in another question, someone had lost their wallet.dat (or moved+renamed and forgot about it) and it appears the wallet file format is not easy to detect by anything other than the file name. So a wallet verification tool would depend on getting source code from the wallet software and knowing which file and encryption/password to verify it with.

If your backup is a "standard" wallet.dat file you have some(1) chance for it to work in many different wallet softwares and apps. Preferably test on a fresh computer that has never been connected to any network (i.e. installed without cables plugged in. Windows 95 could get hacked while the installation software was running the last phases...). Without an extra physical computer, try using a virtual machine-software and create a fresh "computer inside your computer".
If Linux doesn't scare you and your wallet software is available on linux, then you can create a USB-stick with linux on it. Linux Live USB can give you one that runs as a virtual machine, but classical Live USB sticks instead require you to restart your computer with the USB plugged in and might be tricky to get working.

Finally, if you load you wallet backup on an untrusted computer or even a smartphone, you should have prepared in advance a new safe wallet to send your coins to.

And you should NEVER keep a large amount of coins in such a way that it can all be lost or stolen if you get the phone/computer stolen or if you forget a password. Think how much USD/EUR/... cash you would carry with you on a street with risk for pickpockets, robberies, loosing your wallet by clumsiness, etc and use that as a guide for how much bitcoin you should be handling yourself. For bigger sums, first exercise with smaller sums and it is probably wise to spread your risk by using several trusted expert(2) third parties to store your coins, just like you use banks to handle savings accounts.
The time when all "banks" can be removed is not yet. Better, safer apps and hardware wallets need to be created.

(1) In <http://media01.bitcoinarmory.com/InsideBitcoins_Present.pdf> it is explained that wallet encryption works differently in Bitcoin-Qt and Armory, and presumably other wallet software use a weaker but more "standard" wallet encryption.
(2) MtGox has proved again and again they are not experts. Most other well-known online wallets/traders are probably trustable with some bigger sums

> **Comments:**
> **username_0**: I agree with all your points about safety but installing VM for testing wallets is too much effort IMHO. I was wondering if there's a tool that'll verify the wallet file integrity without jumping through hoops. And it's a good point to test any method with a wallet with a tiny amount.  

---

### Answer by username_3 on 2016-07-16. Score: 0

Best method IMHO is to restore the wallet on another (trusty) device, check the balance, **spend a little amount of uBTC** and verify the other address got the money. Then delete securely the test wallet. A VM in this case is very handy.

The key step is to actually spend and test everything goes as expected. If you don't do it you can't never be 100% confident the backup will work

Checking you got the right balance back is not enough because the checking itself does not require the client to actually know the private key


---

