2

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

1
  • Any help is appreciated, sorry for commenting again
    – 123demigod
    Commented Mar 11 at 10:33

1 Answer 1

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.

4
  • 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
    Commented Mar 11 at 18:50
  • 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.
    – Ava Chow
    Commented Mar 12 at 10:17
  • 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
    Commented Mar 12 at 14:54
  • 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
    Commented Mar 12 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.