Is it possible to transfer blockchain data from one computer to another for a full node?

8 replies 152 views
Posts: 26 · Reputation: 248
#1Oct 31, 2020, 12:36 PM
I'm about to move my full node to a new laptop and I'm curious if I need to download the entire blockchain again, or if I can just transfer my existing blockchain over to the new machine. Also, I have another question: can I save the blockchain onto an SD card and use it on both laptops? They both have SD card slots, so I'm thinking it might be an easy way to keep the blockchain updated while switching between the two.
3 Reply Quote Share
HyperRavenFull Member
Posts: 175 · Reputation: 633
#2Oct 31, 2020, 01:36 PM
You can transfer the entire data directory less the wallet.dat to the new computer. This ensures that you won’t have to synchronize again from the start. However, this assumes that you trust the original computer and it has not been tampered with. Ensure that Bitcoin Core has shutdown safely (Bitcoin Core is completely shutdown, without the shutting down dialog). SD cards are generally bad idea for applications requiring speed and high I/O. I’d advise against that or you would probably have an SD card with a shorter lifespan.
2 Reply Quote Share
Posts: 26 · Reputation: 248
#3Oct 31, 2020, 05:29 PM
Got it, thanks
4 Reply Quote Share
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#4Oct 31, 2020, 11:39 PM
I expect the SD-card to work fine without much writing, if you only keep the blocks directory on it, and keep chainstate on your SSD. But that means manually copying that directory every time, which isn't as convenient as you're looking for. I'd get a light wallet (like Electrum) on one laptop, and keep Bitcoin Core on the other.
6 Reply Quote Share
HyperRavenFull Member
Posts: 175 · Reputation: 633
#5Nov 1, 2020, 02:24 AM
Does Bitcoin Core handle the situation when blocks are in sync but the chainstate is out of sync? I've never had this situation before so I'm curious if that works and how long it'd take. SD Cards were notoriously slow in my experience when working with Bitcoin nodes on RPi, even when they're synchronizing several blocks only. I've got a few corrupted SD Cards from this as well, external HDD/SSD would be a better alternative if possible.
1 Reply Quote Share
hash_bossLegendary
Posts: 1166 · Reputation: 5261
#6Nov 1, 2020, 07:47 AM
Yes, but you may want to make sure the SD card always mounted on same path. For example. always mounted on E: if you windows or always mounted on /media/your_username/disk_name if you use Linux. Otherwise, you'll need to tell Bitcoin Core the correct path which is less convenient. It's also worth to mention that SD card for professional usage exist, but usually it's more expensive and slower than buying external SSD drive.
3 Reply Quote Share
humbleledgerLegendary
Posts: 1027 · Reputation: 6554
#7Nov 2, 2020, 06:01 PM
Good point, maybe it just works. In that case it would still need to update chainstate, which means verifying the new blocks. This will take almost as long as just downloading the data again. There are very fast SD-cards nowadays. I have one that's faster than my old HDD. I've never liked external disks for anything other than backups: sometimes even slightly touching the cable is enough to disconnect the drive.
3 Reply Quote Share
colddiamondHero Member
Posts: 623 · Reputation: 2467
#8Nov 4, 2020, 07:31 PM
Also, not knowing your location in the world or the actual equipment involved, but 1TB SSD / m.2 drives are no longer prohibitively expensive. Obviously, this is not universal and can vary a lot based on where are but for the most part if you have a working machine that has the blockchain and you obviously are getting a 2nd working one then the extra money just to get a large enough drive to hold a 2nd copy is probably not going to break the bank. And if you don't mind used then 1TB drives from reputable sources are becoming dirt cheap. -Dave
4 Reply Quote Share
im_lynxHero Member
Posts: 515 · Reputation: 2161
#9Nov 5, 2020, 12:45 AM
Do you speak of SD or microSD cards? I can't say much to SD cards. My very old digital camera uses this type of storage media and doesn't have much demand for write speed. Regarding microSD cards and usage in my various Raspi 4B units, I use mostly Samsung Endurance Pro and some Endurance Evo cards. Those Endurance microSD cards are advertised to have a high write endurance because they're made to be used in surveillance cameras or similar constant write scenarios. They also have a decent write speed. MicroSD cards mostly don't have great iops numbers (this doesn't hurt so much for the blocks directory, likely more for chainstate). Two of my Raspi 4B units, one running RaspiBlitz and another running Umbrel, boot from such Samsung Endurance microSD cards (128GB size), but both units have an attached 1TB SATA SSD for the storage needs of the running Bitcoin Core nodes. Both nodes run 24/7/365 since '21/'22 or so and no microSD issues until today. Unfortunately the Samsung Pro Endurance microSD is only available at max. 256GB capacity, so you can only run a pruned node on it, if you want to store the datadir of Core on it. A better solution for switching between different computers, instead of SD/microSD cards, is in my opinion a portable SSD which you connect via at least USB3. It should be minimum 1TB for a full Core node, but if I had to buy such a SSD new, I'd choose a 2TB version. Here is space consumption of one of my running nodes (txindex and blockfilters are enabled): A 1TB SSD today with my numbers would've ~81% of their capacity used up, slowly growing. It will be fine for quite some time yet, but I'd prefer a 2TB version. More free space, more unused flash blocks for wear-leveling, likely greater longevity. I also run an Electrum server on such a node and then 1TB doesn't leave a comfortable amount of free space left. I'm looking to replace the SSD with a 2TB version pretty soon.
3 Reply Quote Share

Related topics