Fundamentals

How to backup core wallet and how to replace wallet.dat backup file

Recently one of our user come to us and said that their hard disk got corrupt and as a result they can’t access their wallets anymore. But fortunately they had several copy of wallet.dat file. So we advised them to install latest version wallet in another machine and import the original wallet.dat to new wallet client. The user finally got access to their coins. If you are in a similar situation that is if have a backup of your wallet but do not know how to replace this file and restore your core wallet then this guide is for you. In this beginners guide we’ll explain how to restore wallet.dat file safely. But before that let’s see how to backup core wallet and what are the measures you need to take before you backup.

Wallet backup

Hardware failure, software failure, data corruption, blue screen of death, device stolen or whatever it is. As long as you have your wallet backup file stored safely; you can access your coins back. Wallet backup is the most essential measure you must consider in order to keep your holdings safe. There are two ways to backup your Bitcoin core wallet. 1. Wallet.dat and 2. Private keys. For the first one you need to simply copy the wallet.dat and put it in a secure location. For the second one you need to use your wallet console window to export private keys.

Console private key backup

If you are exporting private keys then remember that each wallet address has a unique private key associated. So make sure to export the keys for each and every address for which you have funds. Store this private key information in a USB drive or write it down in a safe place where no one can access this. But for how many address? We know getting private key for each address and managing them is quite difficult. Also if a single letter or digit of your private key gets misplaced then there is no hope of recovery. For this reason we also recommend you to backup your wallet.dat file. For better security both options are recommended and this particular article explains both wallet.dat backup and exporting private keys in detail.

Wallet.dat

When you setup core wallet and open it for the first time the wallet.dat file is also created automatically. The file location of the wallet.dat depends on the operating system. If you haven’t changed the blockchain location then by default your wallet.dat can be found in the following location:

Windows: C:\Users\YourUserName\Appdata\Roaming\Bitcoin

Mac OS X: ~/Library/Application Support/Bitcoin/

Linux: ~/.bitcoin/

This is not only a default directory for Bitcoin but most cryptocurrency core wallet by default puts its data in this location. But if you’ve chosen a custom directory and do not know where it is located then open your wallet, navigate to Help >> Debug Window and in general information you’ll find the Data directory.

Bitcoin core data dir

This is the location where you’ll find wallet.dat file, blockchain and several other files.

wallet.dat file location

The core wallet client stores all private key information in wallet.dat and this file is like a master private key. It is what holds all your addresses, their private keys, transaction data and other information. Remember that if you don’t have access to wallet.dat or private keys then it is not possible to restore your wallet and you won’t have access to your coins. Your Bitcoins are permanently gone and nobody will be able to help you. To backup wallet.dat go to wallet file menu > backup wallet or copy the wallet.dat.

Bitcoin core wallet backup

But simply backing up this wallet.dat file is also not enough. Here are some best practices that you need to follow before you backup.

Wallet.dat – Best practices

To avoid potential fund lose here are few practices that you must follow:

  1. Before you backup your wallet.dat it is essential that you make sure the file is encrypted. If anyone gets access to un-encrypted wallet.dat file they will also have access to your coins. So encrypt your wallet with a strong password and keep this password in memory or write it down in a safe place.
  2. Once encrypted copy the wallet.dat and store it in multiple locations especially one outside of your computer. Since you’ve encrypted the wallet file it is safe to store it in Drop box, Google drive, USB drive or a private cloud storage.
  3. Not just once. It is recommended that you backup your wallet.dat file often. This way you can ensure that the backup file contains all your wallet and change addresses.
  4. Lastly do not share your private keys or backup file to anyone even though this file in encrypted.

Alright! Now as you’ve learned to backup your wallet lets see how to restore backed up wallet.

Note: This core wallet backup and restore tutorial is not only for Bitcoin core but also applies to all other cryptocurrency core wallets. Also this guide is for Windows, but the procedure is same for Linux as well as Mac. The wallet.dat file is cross platform compatible so you can move across different computer or an operating system.

Restoring a backup file to new wallet

First of all we are not going to cover importing private keys for which we’ll make a separate guide. Here we’ll show you how to restore wallet.dat backup file to new wallet client. The process is quite simple.

If you are looking to update your existing wallet then read this wallet update guide.  However if you are looking to restore backup file to new wallet on a new machine then follow the procedure below.

1. Head to the coins GitHub repository and download the latest wallet. In this case it is Bitcoin and you can find the latest core wallet client here: https://github.com/bitcoin/bitcoin/releases

2. Once downloaded, unzip the package and compete the wallet setup. Now open your wallet and close it; which will create all the necessary files. Again make sure the wallet is not running.

3. Now find the location of your current wallet.dat file and replace it with your original wallet backup file.

Note: When you backup you can name the file to anything. For example Bitcoin-backup.dat, LitecoinWallet.dat, Dashbk.dat. But when restoring this file make sure to rename it back to wallet.dat. Also very important that before you restore wallet.dat with a backed up file check whether if the current wallet is storing any coins. If it is so then backup that as well or send the coins to the wallet address that you control. We do not suggest deleting wallet.dat. Instead rename it to old-wallet.dat or something.

Old wallet backup restore

4. Once the wallet backup has been replaced; restart the wallet with -rescan command. Now wait for your wallet to sync and once it is done you can access your restored wallet. If your original backup file is encrypted then you need to use password to unlock your wallet and use the funds.

Did you find this guide helpful? If so then you may also like the following tutorials:

Tags
Show More

coinguides

We are crypto enthusiasts and our main intention with Coin Guides is to educate people about Cryptocurrency and Blockchain technology. We regularly publish content about Bitcoin, Ethereum, Altcoins, wallet guides, mining tutorials and trading tips.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *