Just like with Bitcoin’s wallet.dat file that contains your wallet address and keys and that you need to backup for safety reasons, Ethereum also has a similar wallet file that you should have a spare copy of. With Ethereum the wallet file has a bit weird name and is not just called wallet.dat, but it has essentially the same purpose and the file works essentially the same way as the wallet.dat with Bitcoin and many other alternative crypto coins. Ethereum’s wallet file is stored in the data directory used by the client to store the blockchain and other files, the default locations for the datadir on different operating systems are listed below.
Default datadir locations:
– Mac: ~/Library/Ethereum
– Linux: ~/.ethereum
– Windows: %USERPROFILE%\AppData\Roaming\Ethereum
To get the full path of the data directory on your specific system you can run the geth console and type admin.datadir and you will see a result like on the screenshot above with the full path. Note that the wallet file is not stored in the main datadir folder, but is instead placed in a separate folder under it called keystore. Inside that folder you should see a file with a long name starting with UTC--2015..., this is the wallet file you need to backup. Do note that aside from the wallet file itself you will also need to remember the password (or also back it up along the wallet) that you set when creating your account, without the password needed to unlock it the wallet file won’t be of much use.
If you are moving your Ethereum installation over to a different computer or want to have a copy on another system for solo mining for example, aside from a copy of the wallet file you may also want to make a copy of the blockchain, so that the geth client will not need to download the whole thing again from the network. For the moment the Ethereum blockchain is not that big, but as it continues to grow it can become a very time consuming task to wait for the blockchain to download over the network like it already is with bitcoin for example. So here is how you can also export and then import the Ethereum blockchain should you need to do so.
Export and Import the Ethereum Blockchain:
– Run: geth export blockchain_backup
– Copy the blockchain_backup file to the new system (a bit over 60 MB for the moment)
– On the new system run: geth import blockchain_backup