# Getting private keys from zcashd

**URL:** <https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055>\
**Category:** Technical Support\
**Created:** [March 29, 2019, 1:27pm UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055 "2019-03-29T13:27:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lettemax](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/lettemax/32/12508_2.png) [@lettemax](https://forum.zcashcommunity.com/u/lettemax)\
**Post date:** [March 29, 2019, 1:27pm UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/1 "2019-03-29T13:27:15Z")

</div>

So I’ve got the blockchain fully downloaded and I’m validating transactions. I’ve generated a z-addr. Now I’m wondering how to get my private keys/ recovery phrase in case my laptop fails. Is there a command for this?

---

<div class="post-metadata">

**Author:** ![CitricAcid](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@CitricAcid](https://forum.zcashcommunity.com/u/CitricAcid)\
**Post date:** [March 29, 2019, 1:42pm UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/2 "2019-03-29T13:42:13Z")

</div>

[https://zcash.readthedocs.io/en/latest/rtd\_pages/wallet\_backup.html](https://zcash.readthedocs.io/en/latest/rtd_pages/wallet_backup.html)

---

<div class="post-metadata">

**Author:** ![lettemax](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/lettemax/32/12508_2.png) [@lettemax](https://forum.zcashcommunity.com/u/lettemax)\
**Post date:** [March 29, 2019, 1:55pm UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/3 "2019-03-29T13:55:14Z")

</div>

so i ran exportdir=pathtomyexportdir, got no message, then ran  
zcash-cli backupwallet backupname  
and got this error  
error code: -4  
error message:  
Cannot backup wallet until the -exportdir option has been set

---

<div class="post-metadata">

**Author:** ![CitricAcid](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@CitricAcid](https://forum.zcashcommunity.com/u/CitricAcid)\
**Post date:** [March 29, 2019, 2:22pm UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/4 "2019-03-29T14:22:48Z")

</div>

You did not do this step first – include an export directory setting in your config file (zcash.conflocated in the data directory which is `~/.zcash/` unless it’s been overridden with `datadir=` setting):

---

<div class="post-metadata">

**Author:** ![lettemax](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/lettemax/32/12508_2.png) [@lettemax](https://forum.zcashcommunity.com/u/lettemax)\
**Post date:** [March 29, 2019, 2:54pm UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/5 "2019-03-29T14:54:49Z")

</div>

i thought i did that. what is the command?

---

<div class="post-metadata">

**Author:** ![CitricAcid](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@CitricAcid](https://forum.zcashcommunity.com/u/CitricAcid)\
**Post date:** [March 29, 2019, 3:04pm UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/6 "2019-03-29T15:04:20Z")

</div>

It’s not a command it a file you need to manually edit located in the data directory

---

<div class="post-metadata">

**Author:** ![lettemax](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/lettemax/32/12508_2.png) [@lettemax](https://forum.zcashcommunity.com/u/lettemax)\
**Post date:** [March 29, 2019, 3:07pm UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/7 "2019-03-29T15:07:16Z")

</div>

so how do i navigate there from the /zcash directory

---

<div class="post-metadata">

**Author:** ![CitricAcid](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@CitricAcid](https://forum.zcashcommunity.com/u/CitricAcid)\
**Post date:** [March 29, 2019, 5:08pm UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/8 "2019-03-29T17:08:56Z")

</div>

where ever the file is installed on your computer is where the config file is.

I do not have it installed so I can’t give you an exact location

---

<div class="post-metadata">

**Author:** ![garethtdavies](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/garethtdavies/32/210_2.png) [@garethtdavies](https://forum.zcashcommunity.com/u/garethtdavies)\
**Post date:** [March 30, 2019, 1:20am UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/9 "2019-03-30T01:20:52Z")

</div>

zcash.conf is in the following location (unless you specifically pass the `-conf` flag to zcashd)

Windows: `%HOMEPATH%\AppData\Roaming\Zcash\zcash.conf`  
macOS: `~/Library/Application Support/Zcash/zcash.conf`  
Linux: `~/.zcash/zcash.conf`

You can either add `exportdir=pathtomyexportdir ` to that zcash.conf or add as an option when starting zcashd i.e. `zcashd -exportdir=pathtomyexportdir` plus whatever other options you may have. Either way you will need to restart zcashd so maybe that’s the issue? Stop with `zcash-cli stop` and then restart with that line in your zcash.conf.

---

<div class="post-metadata">

**Author:** ![jumparo](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@jumparo](https://forum.zcashcommunity.com/u/jumparo)\
**Post date:** [August 25, 2019, 9:32am UTC](https://forum.zcashcommunity.com/t/getting-private-keys-from-zcashd/33055/10 "2019-08-25T09:32:07Z")

</div>

I exported it successfully, but the folder doesn’t appear where it should be… I’ve tried in terminal

`> ls -a`

also show hidden folders in the folder options. (ubuntu)  
Any ideas,why?
