Bitcoin Forum
May 17, 2024, 01:07:17 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Transferring Bitcoin Blockchain from old drive to a new one  (Read 155 times)
Digitman (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 3


View Profile
September 04, 2023, 03:09:55 PM
Merited by vapourminer (1), LoyceV (1), ABCbits (1)
 #1

Hello
I was testing Umbrel as I want to start learning how to run my Lightning network. I installed Umbrel on my Raspberry Pi4 and downloaded the BTC blockchain.
I have been running into few issues of stability with Umbrel and I am thinking of moving to another OS (it is part of the testing and learning)

So my question is how can I avoid formatting the hard drive and lose all the BTC blockchain I downloaded, if anyone has a procedure on how to back up the chain and copying it to a new OS install, that would be great!  Smiley

I tried to look for some guides but couldn't find a step by step one

Thanks for reading me...
LoyceV
Legendary
*
Offline Offline

Activity: 3318
Merit: 16662


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
September 04, 2023, 03:14:34 PM
Merited by vapourminer (1), ABCbits (1), tranthidung (1)
 #2

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.

satscraper
Hero Member
*****
Offline Offline

Activity: 742
Merit: 1393


View Profile
September 04, 2023, 04:32:20 PM
 #3

how can I avoid formatting the hard drive and lose all the BTC blockchain I downloaded,

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.
BitMaxz
Legendary
*
Offline Offline

Activity: 3262
Merit: 2974


Block halving is coming.


View Profile WWW
September 04, 2023, 08:06:43 PM
 #4

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.

Code:
/home/umbrel/umbrel/bitcoin

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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Digitman (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 3


View Profile
September 05, 2023, 12:14:30 PM
 #5

Thank you guys for your inputs   Smiley

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
LoyceV
Legendary
*
Offline Offline

Activity: 3318
Merit: 16662


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
September 05, 2023, 02:11:36 PM
 #6

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
I'd shorten these 3 lines to:
Code:
scp -r <username>@<raspberry_pi_ip>:/path/to/.bitcoin /path/to/local/Downloads
My Bitcoin Core installation doesn't have a directory "indexes".

Quote
It requires the use of another strorage drive or some ssh connection to another machine to transfer data but that's the idea
But: if you have to ask how to copy files on your local system, I can't really recommend using with SSH.

Cricktor
Hero Member
*****
Offline Offline

Activity: 770
Merit: 1125


Crypto Swap Exchange


View Profile
September 09, 2023, 10:25:01 PM
Merited by vapourminer (1)
 #7

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

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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BitMaxz
Legendary
*
Offline Offline

Activity: 3262
Merit: 2974


Block halving is coming.


View Profile WWW
September 10, 2023, 11:40:50 AM
 #8


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

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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
LoyceV
Legendary
*
Offline Offline

Activity: 3318
Merit: 16662


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
September 10, 2023, 11:44:04 AM
 #9

Using scp How long did it take you to transfer the blockchain files to another machine?
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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!