<blockquote>
<p>If i copy chainstate, txindex and other files and paste them in same folder as blocksdata, change the .conf file in roaming folder and point datadir to SSD folder with the blocksdata in them, will it work if i run bitcoind from roaming</p>
</blockquote>
<p>Yes. As long as you move everything, that will be fine. Note that you can only have one bitcoin.conf file, so any config options you want changed will have to be in the bitcoin.conf in the default data directory. But that can also have a <code>datadir=&lt;path&gt;</code> line to point to the location where all of the actual data will be stored.</p>
<blockquote>
<p>Do i also have to change the cookie path in .conf file with #rpccookiefile=</p>
</blockquote>
<p>No, that only matters if you want to have the rpc cookie stored somewhere outside of the expected data directory. Otherwise, it will be able to find it in the configured data directory.</p>
<p>Additionally, <code>#</code> at the beginning of the line means that the line is commented out, i.e. it is ignored. So changing that line wouldn't do anything anyways.</p>

CC BY-SA 4.0
2024-03-11T18:50:22.447Z
But my .conf file is located in C:\Users\ABC\Bitcoin, where the actual installation is

as well as weird enough i find the same .conf file in roaming folder too, although i never copied it there

also the CLI will auto fetch the directory details coz the applications are installed in
C:\Users\ABC\Bitcoin
123demigod
CC BY-SA 4.0
2024-03-12T10:17:02.600Z
Unless you've specifically configured it to read the conf file from a different location, Bitcoin Core will always use the conf file in the default datadir. It does not know nor care about the installation location. The details about the config options in use, including the location of the conf file in use, are logged into the debug.log file on every startup. Check in there if you are unsure. The conf file in your installation location may simply be the sample conf file.
Ava Chow
CC BY-SA 4.0
2024-03-12T14:54:05.280Z
Ok just saw the .conf file is fetched from appdata/roaming/bitcoin in debug file

am sorry for being such a noob

so now when i change the datadir=abc:\\xyz

i have to copy the .conf file to abc:\\xyz?

or leave it here and copy rest of the folders and files chainstate, indexes, wallets, .cookie, .lock, etc....
123demigod
CC BY-SA 4.0
2024-03-12T14:58:04.840Z
You have to leave the conf file there otherwise bitcoind won't know where to look for your data. Don't copy the conf file as the conf file in the new datadir location will be ignored as it will have already loaded the conf file from the default location.
Ava Chow
CC BY-SA 4.0
2024-03-11T14:55:45.330Z
2024-03-11T14:55:45.330Z
Ava Chow
<p>User likely asking about Linux, but for Windows I found the location in the registry under <code>Computer\HKEY_CURRENT_USER\SOFTWARE\Bitcoin\Bitcoin-Qt</code>, named <code>strDataDir</code></p>

CC BY-SA 4.0
2024-08-18T19:18:24.403Z
2024-08-18T19:18:24.403Z
Dan
<p>I use Bitcoin CLI and not the QT one, when syncing i used a external SSD to store blocksdata in SSD, obviously noob me didnt know of datadir function</p>
<p>Now my Chainstate, txindex are in roaming folder whereas blocks are in external SSD</p>
<p>1- If i copy chainstate, txindex and other files and paste them in same folder as blocksdata, change the .conf file in roaming folder and point datadir to SSD folder with the blocksdata in them, will it work if i run bitcoind from roaming</p>
<p>2- Do i also have to change the cookie path in .conf file with #rpccookiefile=</p>
<p>Any help is appreciated</p>

CC BY-SA 4.0
2024-03-11T10:33:07.637Z
Any help is appreciated, sorry for commenting again
123demigod
<bitcoin-core><blockchain><bitcoind><bitcoin-core-development><bitcoin-cli>
Moving the entire directory to new location for Bitcoin Core CLI
123demigod
# Moving the entire directory to new location for Bitcoin Core CLI

(Asked by: username_0 on 2024-03-10)

I use Bitcoin CLI and not the QT one, when syncing i used a external SSD to store blocksdata in SSD, obviously noob me didnt know of datadir function

Now my Chainstate, txindex are in roaming folder whereas blocks are in external SSD

1- If i copy chainstate, txindex and other files and paste them in same folder as blocksdata, change the .conf file in roaming folder and point datadir to SSD folder with the blocksdata in them, will it work if i run bitcoind from roaming

2- Do i also have to change the cookie path in .conf file with #rpccookiefile=

Any help is appreciated

**Tags:** bitcoin-core, blockchain, bitcoind, bitcoin-core-development, bitcoin-cli

> **Comments:**
> **username_0**: Any help is appreciated, sorry for commenting again  

---

## 2 answers

### Answer by username_1 on 2024-03-11. Score: 3

> If i copy chainstate, txindex and other files and paste them in same folder as blocksdata, change the .conf file in roaming folder and point datadir to SSD folder with the blocksdata in them, will it work if i run bitcoind from roaming

Yes. As long as you move everything, that will be fine. Note that you can only have one bitcoin.conf file, so any config options you want changed will have to be in the bitcoin.conf in the default data directory. But that can also have a `datadir=<path>` line to point to the location where all of the actual data will be stored.

> Do i also have to change the cookie path in .conf file with #rpccookiefile=

No, that only matters if you want to have the rpc cookie stored somewhere outside of the expected data directory. Otherwise, it will be able to find it in the configured data directory.

Additionally, `#` at the beginning of the line means that the line is commented out, i.e. it is ignored. So changing that line wouldn't do anything anyways.

> **Comments:**
> **username_0**: But my .conf file is located in C:\Users\ABC\Bitcoin, where the actual installation is  as well as weird enough i find the same .conf file in roaming folder too, although i never copied it there  also the CLI will auto fetch the directory details coz the applications are installed in C:\Users\ABC\Bitcoin  
> **username_1**: Unless you've specifically configured it to read the conf file from a different location, Bitcoin Core will always use the conf file in the default datadir. It does not know nor care about the installation location. The details about the config options in use, including the location of the conf file in use, are logged into the debug.log file on every startup. Check in there if you are unsure. The conf file in your installation location may simply be the sample conf file.  
> **username_0**: Ok just saw the .conf file is fetched from appdata/roaming/bitcoin in debug file  am sorry for being such a noob  so now when i change the datadir=abc:\\xyz  i have to copy the .conf file to abc:\\xyz?  or leave it here and copy rest of the folders and files chainstate, indexes, wallets, .cookie, .lock, etc....  
> **username_1**: You have to leave the conf file there otherwise bitcoind won't know where to look for your data. Don't copy the conf file as the conf file in the new datadir location will be ignored as it will have already loaded the conf file from the default location.  

---

### Answer by username_2 on 2024-08-18. Score: 0

User likely asking about Linux, but for Windows I found the location in the registry under `Computer\HKEY_CURRENT_USER\SOFTWARE\Bitcoin\Bitcoin-Qt`, named `strDataDir`


---

