Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: callmejoe on February 14, 2024, 08:07:14 PM



Title: [Solved] copying a pruned blockchain to another computer not working
Post by: callmejoe on February 14, 2024, 08:07:14 PM
I'm using a pruned blockchain with bitcoin core version26 without any issues.  I copied the blocks and chainstate folders and wallet.dat file over to another computer.  but when i start bitcoin core it tells me i need to reindex the blockchain which will redownload the entire blockchain.

copying a pruned blockchain like this should work right?


Title: Re: copying a pruned blockchain to another computer not working
Post by: BitMaxz on February 14, 2024, 08:30:41 PM
Pruned setup still needs the latest blocks that is it tells you to run Bitcoin core with -reindex.

If I were you since it's pruned instead of copying the downloaded blockchain, I suggest to remove the blocks and chainstate folder and let the Bitcoin core sync and download the latest blocks if the prune size is not that big.


Title: Re: copying a pruned blockchain to another computer not working
Post by: Findingnemo on February 14, 2024, 09:15:22 PM
copying a pruned blockchain like this should work right?

Yes, it will work, but when qt requires reindexing the software is not accessing the filed properly or some part of the copied file is corrupted.

Check the bitcoin.conf is in the right directory where you copied the blockchain file.

And also check the pruning value is same as the value where you copied.


Title: Re: copying a pruned blockchain to another computer not working
Post by: callmejoe on February 15, 2024, 02:54:10 AM
i mostly use linux but wanted a copy on a Windows machine in case a family member needed to access it since linux would be totally foreign to them.  I'm laughing now because it probably doesn't matter what OS it's on.  Bitcoin will harder to explain to them than linux :) 

Anyway, i had the blockchain on another hard drive separate from the Windows OS that just had files/documents on it (formatted as NTFS too).  I did have that location in the config file.  So from the comments here i decided to just move the blockchain files to the Windows default location and now Bitcoin is running without a problem with the pruned blockchain.

A little annoyed it didnt work the way I wanted it, but I'll call it a win nonetheless.

 



 


Title: Re: copying a pruned blockchain to another computer not working
Post by: nc50lc on February 15, 2024, 04:28:48 AM
A little annoyed it didnt work the way I wanted it, but I'll call it a win nonetheless.
That's because if the settings are all originally in "bitcoin.conf" file inside the default bitcoin datadir, you should also put that config file in the default bitcoin data directory of the other machine
and put the datadir files in the custom data directory (datadir=) that you've set, Linux and Windows have different path formats so make sure to edit it accordingly.
When staring Core, do not set the data directory using the 'Welcome Screen' for it to read the config file in the default datadir.

On the other hand, if you've originally set the custom data directory and prune settings in the Welcome Screen,
You should also set those settings in the Bitcoin Core in your other machine's Welcome Screen, then put the datadir files in that custom datadir including the bitcoin.conf inside it.
(in this case, it wont create anything in the default datadir unless you use bitcoind without --datadir arg)
Putting the datadir files inside the default will also work as long as you don't set the datadir in the Welcome Screen, set prune setting there if it's not in the config file.

Pruned setup still needs the latest blocks that is it tells you to run Bitcoin core with -reindex.

If I were you since it's pruned instead of copying the downloaded blockchain, I suggest to remove the blocks and chainstate folder and let the Bitcoin core sync and download the latest blocks if the prune size is not that big.
In Pruned mode, performing a -reindex will trigger a download of the entire blockchain from scratch, not just the latest blocks.
Deleting the "blocks" folder will delete the blockchain itself, and you knw what will happen.
Deleting the chainstate will require the node to reindex-chainstate to rebuild it and since it's in pruned mode, it will have to redownload all the blocks to do that.

Pruned mode isn't a setting to download just the target size, it also downloads and verify all the blocks then delete the older already-verified ones to accommodate the target size.