Recover wallet from wallet.dat (no backup)?

Hi there,

I'm wondering if it's possible to restore a account if one has copied the wallet.dat from ~/.zcash/wallet.dat?
Note I'm not talking about a wallet.dat created using the zcash-cli options export/backup but a raw data copy of the original wallet.dat.

I'm trying to import such a wallet.dat using zcash-cli but this only gives me this error:

error code: -8
error message: Cannot open wallet dump file

Basically, the wallet.dat should contain all the data of the account, correct?
I own the wallet.dat and the passphrase - is there any way to recover the accounts from that wallet?

Cheers

We got this handled over on the rocket.chat, but for anyone else who sees this and wonders what the solution was, it was to (on a fresh installation of zcash) drop the wallet.dat file directly into the ~/.zcash/ directory on top of the newly created empty one, when zcashd is stopped.

1 Like

That's correct. It didn't work for me the first time I tried for some reason but worked as expected on the second try.
Of course you should make sure zcashd is not running before coping the wallet.dat to ~/.zcash/.
As daria mentioned once you're done with that you should run zcashd with the -reindex option. E.g.:

zcashd -reindex

From the cli-help here's what it does:

-reindex
Rebuild block chain index from current blk000??.dat files on startup

1 Like

Yes I'm glad she mentioned -reindex!