Bitcoin Forum

Other => Beginners & Help => Topic started by: RedGolpe on July 23, 2012, 06:48:01 PM



Title: Backup and restore encryptrd wallet
Post by: RedGolpe on July 23, 2012, 06:48:01 PM
I've read the various guides about this topic and searched around the forum but I'm not sure the information I found are reliable with the new bitcoind client. So, I encrypt my wallet, store a backup copy somewhere else, but I'm not sure what to do when restoring it. Should I still delete wallet.dat, blkindex.dat and blk0001.dat, restore wallet.dat and let the client perform the whole block scan again? Does the program still know that the wallet is encrypted? Or should I encrypt the new wallet.dat with the same passphrase again before restoring the old one? Thank you in advance.


Title: Re: Backup and restore encryptrd wallet
Post by: DeathAndTaxes on July 23, 2012, 06:54:00 PM
The wallet.dat is the only file which contains your private keys (aka "your wallet").



To make a backup:
copy the wallet.dat somewhere safe.
If you AREN'T using client encryption you should encrypt the file w/ third party software.
If you ARE using the client encryption it is already encrypted you are done.

To restore a backup:
copy the saved wallet.dat to the bitcoin data directory.
Your done.


If you start bitcoin client with NO WALLET.DAT then Bitcoin will make a new empty wallet but understand that empty wallet has different (random) addresses.  It is worthless from a back up point of view.  Simply delete it and copy the backup wallet.dat to the data directory.


Title: Re: Backup and restore encryptrd wallet
Post by: RedGolpe on July 23, 2012, 06:56:12 PM
Thank you for the fast and clear reply.


Title: Re: Backup and restore encryptrd wallet
Post by: DeathAndTaxes on July 23, 2012, 07:00:32 PM
One thing I would add.  If you run into problems where the client won't show coins, or reports errors you can
1) ALWAYS make a copy of your wallet.dat (even if you are "sure" you don't need to)
2) delete EVERYTHING inside the data dir
3) copy the wallet.dat back to the data dir
4) start Bitcoin

Bitcoin will start "fresh" and established connections to the network and download/verify the blockchain starting with block zero.

NOTE: you probably don't need to do this. For some reasons new users love to jump past all troubleshooting to this step (sometimes throwing a complete uninstall and reinstall in there) FIRST.  99% of the time this isn't necessary but if you get stuck here is a way to "restart".  

As long as your wallet.dat is safe* your coins are safe even if temporarily the client won't open/sync/update/verify/get latest block/insert random error here.

* safe means a good up to date copy of the wallet.dat and the correct passphrase.