<p>If you want your wallet database (file) to be in a different directory than your data directory, you can use the <code>-wallet=&lt;path&gt;</code> startup option to specify a custom path to your wallet.</p>
<p>Quoting the manpage:</p>
<blockquote>
<p>-wallet=&lt; path &gt;<br />
Specify wallet database path. Can be specified multiple times to
load multiple wallets. Path is interpreted relative to  &lt;wallet‐
dir&gt;  if  it is not absolute, and will be created if it does not
exist (as a directory  containing  a  wallet.dat  file  and  log
files).  For backwards compatibility this will also accept names
of existing data files in .)</p>
</blockquote>

CC BY-SA 4.0
2020-06-21T08:11:54.937Z
2020-06-21T08:11:54.937Z
Antoine Poinsot
<p>I run bitcoin-core QT and I downloaded the <strong>full ledger data to an external HD</strong> so I can move between machines. My wallet.dat file is secured someplace else.</p>
<p>I start-up the QT client giving the external hard disk as the data root.</p>
<p>So <strong>after I put my real wallet.dat file in the data directory</strong> (and restart the client with <code>-rescan</code>):</p>
<p><em>Do I really have to keep it in the directory where the ledger data is saved? Is that safe?</em></p>

CC BY-SA 4.0
2020-06-20T18:13:09.087Z
You can use the `-wallet=<path>` startup option to specify a custom path to your wallet.
Antoine Poinsot
CC BY-SA 4.0
2020-06-20T18:43:00.757Z
@darosior Is this the recommended approach when one wants to have the ledger data in a separate place? please add an answer so I can mark it as the correct answer.
Felipe
CC BY-SA 4.0
2020-06-21T08:13:09.680Z
It seems to me to be the most straightforward one. Added an answer.
Antoine Poinsot
<bitcoin-core><wallet><security><bitcoin-qt-setup>
Do I really have to place my wallet file in the data directory?
Felipe
# Do I really have to place my wallet file in the data directory?

(Asked by: username_0 on 2020-06-20)

I run bitcoin-core QT and I downloaded the **full ledger data to an external HD** so I can move between machines. My wallet.dat file is secured someplace else.

I start-up the QT client giving the external hard disk as the data root.

So **after I put my real wallet.dat file in the data directory** (and restart the client with `-rescan`):

*Do I really have to keep it in the directory where the ledger data is saved? Is that safe?*

**Tags:** bitcoin-core, wallet, security, bitcoin-qt-setup

> **Comments:**
> **username_1**: You can use the `-wallet=<path>` startup option to specify a custom path to your wallet.  
> **username_0**: @darosior Is this the recommended approach when one wants to have the ledger data in a separate place? please add an answer so I can mark it as the correct answer.  
> **username_1**: It seems to me to be the most straightforward one. Added an answer.  

---

## 1 answers

### Answer by username_1 on 2020-06-21. Score: 2 | Accepted answer

If you want your wallet database (file) to be in a different directory than your data directory, you can use the `-wallet=` startup option to specify a custom path to your wallet.

Quoting the manpage:

> -wallet=< path >  
> Specify wallet database path. Can be specified multiple times to
> load multiple wallets. Path is interpreted relative to  if it is not absolute, and will be created if it does not
> exist (as a directory containing a wallet.dat file and log
> files). For backwards compatibility this will also accept names
> of existing data files in .)


---

