Moving Bitcoin Blockchain to a New Hard Drive

8 replies 118 views
5igm42014Full Member
Posts: 26 · Reputation: 266
#1Aug 14, 2024, 10:16 PM
Hey everyone I was giving Umbrel a shot since I'm eager to learn about running my Lightning network. I set it up on my Raspberry Pi4 and got the BTC blockchain downloaded. I've been hitting some stability issues with Umbrel, so I’m considering switching to a different OS as part of my testing and learning process. I’m wondering how I can transfer the blockchain without formatting the hard drive and potentially losing all the BTC data I’ve downloaded. If anyone knows a method to back up the blockchain and move it over to a new OS installation, I’d really appreciate the help! I searched for guides but couldn’t find a detailed step-by-step one. Thanks for reading this...
4 Reply Quote Share
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#2Aug 15, 2024, 11:57 PM
I don't know Umbrel, but usually you'd just copy your home directory to the new system. Create a backup and restore the data. If you want to keep switching OS without reformatting, it's easiest to keep /home on a separate partition (but I guess it's too late for that now). If you don't want to create a backup, and don't want to format, you can YOLO and manually remove all files other than your home directory after you boot the installation disk for your new OS, and then install without formatting.
0 Reply Quote Share
silentchainHero Member
Posts: 473 · Reputation: 2317
#3Aug 16, 2024, 02:45 AM
The easiest way  to avoid HDD formatting is to install new OS on fresh drive, preferably SSD, and then copy Bitcoin Core data from  /umbrel/bitcoin/ to new  directory you assign for bitcoin,  Sure such approach involves some extra expenses to buy new SSD but the pros of it are obvious - you will have a backup ( on your old drive) of blockchain. It will  help resolve  problems if  LevelDB files get corrupted ( for some reason) on you main SSD drive.
0 Reply Quote Share
coin_sigmaLegendary
Posts: 1275 · Reputation: 5553
#4Aug 16, 2024, 06:46 AM
Did you boot the Umbrel OS on the external drive? Just asking this because you said you don't want to format the hard drive. Why not buy an SD card instead to install OS 64 GB SD card would be enough and use the hard drive as your external drive and set up Bitcoin core then point it to the external drive where your Bitcoin folder is located. I think you can find the Bitcoin data from the hard drive in the directory below. Or check this link below you might get some ideas and suggestions on how to backup/copy the blockchain data. -  https://github.com/getumbrel/umbrel-os/issues/119#issuecomment-774775026
1 Reply Quote Share
5igm42014Full Member
Posts: 26 · Reputation: 266
#5Aug 17, 2024, 04:49 PM
Thank you guys for your inputs    I also got this from someone : scp -r <username>@<raspberry_pi_ip>:/path/to/bitcoin/blocks /path/to/local/Downloads scp -r <username>@<raspberry_pi_ip>:/path/to/bitcoin/chainstate /path/to/local/Downloads scp -r <username>@<raspberry_pi_ip>:/path/to/bitcoin/indexes /path/to/local/Downloads It requires the use of another strorage drive or some ssh connection to another machine to transfer data but that's the idea I hope this can help others looking to avoid downloading the full blockchain again
0 Reply Quote Share
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#6Aug 17, 2024, 09:48 PM
I'd shorten these 3 lines to: My Bitcoin Core installation doesn't have a directory "indexes". But: if you have to ask how to copy files on your local system, I can't really recommend using with SSH.
1 Reply Quote Share
im_lynxHero Member
Posts: 515 · Reputation: 2161
#7Aug 18, 2024, 03:38 PM
A Raspi 4B doesn't have enough power budget for its USB interfaces to operate a second HDD or SSD storage device (total max. power budget for all USB connectors together is ~1.2A or ~6W; that's just enough for one SSD or HDD drive). It would only work if at least one of the USB3-SATA-adapters had an own power supply for the connected storage drive or using a sufficiently powered USB-hub.
3 Reply Quote Share
coin_sigmaLegendary
Posts: 1275 · Reputation: 5553
#8Aug 20, 2024, 12:35 AM
Using scp How long did it take you to transfer the blockchain files to another machine? According to the link I provided above it would take too long compared to using rsync instead of using scp. I hope you are not waiting until now to finish transferring blockchain data.
3 Reply Quote Share
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#9Aug 21, 2024, 07:17 PM
In my experience, scp is slower because it needs some time between files, and can't use compression. But for 100 MB files that won't compress much it shouldn't matter much. I had to look it up, it turns out both rsync and scp can use compression nowadays.
1 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics