Wallet.dat deleted

If you have the wallet.dat file on an external disk, then do the following:

  • Make sure ZecWallet is shut down.

  • Copy the wallet.dat file from the external disk to the node’s data directory (the directory where zcash.conf is). Don’t move the file, keep the backup on the external disk. In the case of ZecWallet on Windows, the data directory on recent Windows versions would usually be <Windows drive>:\Users\<username>\AppData\Roaming\Zcash. If there’s an existing wallet.dat in the way, rename that one to wallet.old first.

  • In the same directory, rename zcash.conf to zcash.conf.txt (accepting the prompt that this may make the file unusable, if you’re using the GUI). Double-click this file to edit it in notepad. Add the following lines at the end:

    reindex=1
    rescan=1

    and save the file.

  • Rename zcash.conf.txt back to zcash.conf.

  • Run ZecWallet and wait for it to fully resync. This may take several days depending on the speed of your network connection.

  • After it has synced, shut down ZecWallet and make sure to reedit zcash.conf to remove the reindex=1 and resync=1 lines before starting ZecWallet again.

(@adityapk00, is there a simpler way to pass the reindex and resync options to zcashd?)

1 Like