<p>the funds are linked to your "compromised" keys. They are not in your wallet. So you can generate a new set of keys (as you mentioned, by creating a new wallet), and then transfer from old address to new address. Before you start anything, think of backups! Procedure might be like this (attention: wallet dirs on Windows, Unix and OSX locations differ, depending on your OS, you may want to adopt): </p>

<pre><code>0.) stop bitcoind or UI
1.) backup of old (compromised) wallet to USB stick
2.) rename bitcoin wallet directory to s.th. like "OLD_bitcoin_dir"
3.) start bitcoin (it will create new wallet and keys, get one of the public keys via MENU-&gt;FILE-&gt;RECEIVE ADDRESSES, cut&amp;paste or write it down)
4.) stop bitcoind or UI
5.) rename wallet directory to s.th. like "NEW_bitcoin_dir"
6.) rename wallet directory "OLD_bitcoin_dir" to your original name
7.) start bitcoin
8.) transfer your funds to your new address from step 3
9.) wait until you "see" in a block explorer your funds on the new address
10.) stop bitcoin
11.) delete wallet dir
12.) rename wallet directory "NEW_bitcoin_dir" to your original name 
13.) check if funds are all there
14.) don't forget to backup again :-)
</code></pre>

<p>Hope this is the way to go, if there is an easier way within Bitcoin Core, I'd be happy to hear from the experts... </p>

CC BY-SA 3.0
2017-11-01T18:41:45.723Z
Note: you can also use the `-wallet` command line parameter when you start bitcoin to specify which wallet to load rather than having to rename them each time :)
meshcollider
CC BY-SA 3.0
2017-11-02T09:59:19.303Z
I use Windows OS. What is the "bitcoin wallet directory" on Windows and where can i find it?
i have "bitcoin-data" directory on separate hard drive and few subfolders inside it ("blocks", "chainstate", "testnet3"). And wallet.dat file inside "bitcoin-data".
alexey2baranov
CC BY-SA 3.0
2017-11-02T14:47:54.483Z
ugh, Windows, I don't know. Usually, the "bitcoin wallet directory" is were your wallet.dat file is. Look at the comment from MeshCollider. You may want to go into the help menu, and choose "commandline options", and search for -wallet. This tells you how to provide a parameter to your folders or subfolders, where the file "wallet.dat" resides. Have a backup already? :-)
pebwindkraft
CC BY-SA 3.0
2017-11-01T08:54:47.647Z
2017-11-01T08:54:47.647Z
pebwindkraft
<p>I have my old wallet which private key is compromised. So my reasonable way is to open new wallet and move all bitcoins from compromised wallet to new wallet. </p>

<p>I use Bitcoin Core. I do not trust any online wallets because private key stored into remote store.
So how can i open new wallet and move all bitcoin to it using Bitcoin Core only?</p>

CC BY-SA 3.0
2017-11-27T04:37:55.647Z
the best way is
1. close bitcoin-core
2.rename wallet.dat file to wallet-old.dat 
3.start bitcoin-core (it creates new wallet and new wallet.dat file)
4. user bitecoin-core --wallet parameter to switch between new and old wallets
alexey2baranov
<bitcoin-core><security><private-key>
How to open new wallet into Bitcoin Core and switch between?
alexey2baranov
# How to open new wallet into Bitcoin Core and switch between?

(Asked by: username_0 on 2017-11-01)

I have my old wallet which private key is compromised. So my reasonable way is to open new wallet and move all bitcoins from compromised wallet to new wallet.

I use Bitcoin Core. I do not trust any online wallets because private key stored into remote store.
So how can i open new wallet and move all bitcoin to it using Bitcoin Core only?

**Tags:** bitcoin-core, security, private-key

> **Comments:**
> **username_0**: the best way is 1. close bitcoin-core 2.rename wallet.dat file to wallet-old.dat  3.start bitcoin-core (it creates new wallet and new wallet.dat file) 4. user bitecoin-core --wallet parameter to switch between new and old wallets  

---

## 1 answers

### Answer by username_1 on 2017-11-01. Score: 2 | Accepted answer

the funds are linked to your "compromised" keys. They are not in your wallet. So you can generate a new set of keys (as you mentioned, by creating a new wallet), and then transfer from old address to new address. Before you start anything, think of backups! Procedure might be like this (attention: wallet dirs on Windows, Unix and OSX locations differ, depending on your OS, you may want to adopt):

```
0.) stop bitcoind or UI
1.) backup of old (compromised) wallet to USB stick
2.) rename bitcoin wallet directory to s.th. like "OLD_bitcoin_dir"
3.) start bitcoin (it will create new wallet and keys, get one of the public keys via MENU->FILE->RECEIVE ADDRESSES, cut&paste or write it down)
4.) stop bitcoind or UI
5.) rename wallet directory to s.th. like "NEW_bitcoin_dir"
6.) rename wallet directory "OLD_bitcoin_dir" to your original name
7.) start bitcoin
8.) transfer your funds to your new address from step 3
9.) wait until you "see" in a block explorer your funds on the new address
10.) stop bitcoin
11.) delete wallet dir
12.) rename wallet directory "NEW_bitcoin_dir" to your original name 
13.) check if funds are all there
14.) don't forget to backup again :-)

```

Hope this is the way to go, if there is an easier way within Bitcoin Core, I'd be happy to hear from the experts...

> **Comments:**
> **username_2**: Note: you can also use the `-wallet` command line parameter when you start bitcoin to specify which wallet to load rather than having to rename them each time :)  
> **username_0**: I use Windows OS. What is the "bitcoin wallet directory" on Windows and where can i find it? i have "bitcoin-data" directory on separate hard drive and few subfolders inside it ("blocks", "chainstate", "testnet3"). And wallet.dat file inside "bitcoin-data".  
> **username_1**: ugh, Windows, I don't know. Usually, the "bitcoin wallet directory" is were your wallet.dat file is. Look at the comment from MeshCollider. You may want to go into the help menu, and choose "commandline options", and search for -wallet. This tells you how to provide a parameter to your folders or subfolders, where the file "wallet.dat" resides. Have a backup already? :-)  

---

