Author

Topic: Recovery Options for BTC Full Node: Windows GUI (Read 181 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
IF AND WHEN that time comes, when I have to re-paste in the entire data directory (Bitcoin), I just hope that there will be no errors with permissions. Come to think of it, in Roaming I have some programs I never use. I could test one in exactly the way I would do with Bitcoin . . .

Windows security is rather lax by default for user data, so it's very unlikely you'll encounter permission error.

I am very ambivalent about UPS's: a. You also need to connect your monitor which uses more power

It's true, although AFAIK many monitor only use 15-25 watt.

b. You only have some minutes to shutdown and we can't be at our computers 24/7

I agree, it's rather annoying. The only solution is using UPS which can communicate with your computer[1]. But you need to make extra steps when you use Linux[2].

I use a cold wallet and run the Core to support the blockchain.
If that's the case, I assume bandwidth isn't a problem. Correct? I'd go without backups: if a power outage breaks your blocks directory, just let it sync from scratch.

If you could afford to make a backup, i would recommend you to do it rather than "wasting" resource of other Bitcoin node.



[1] https://www.howtogeek.com/183102/how-to-gracefully-shutdown-your-pc-with-a-ups-unit-and-why-you-should/
[2] https://superuser.com/a/1021439
legendary
Activity: 2212
Merit: 7064
As you know, the worst thing that can happen is an unintended pc shutdown (e.g. power outage) that prevents a Core shutdown and leads to various kinds of corruption.  Having to uninstall and re-start IBD from the genesis block is a major hassle tantamount to having to do a clean OS install after an irrecoverable OS crash.
I don't know how often power outages happen in your area, but you can always add extra layer of protection with UPS devices and surge protectors.
You can even run bitcoin node on your laptop and good battery will serve as a protector, so you could avoid any corruption if power outage is short term, and you could manually shut down later.
You could also think about installing solar panels that could have multiple use cases in your home.
There is no real protection for longer power outages, but you shouldn't run bitcoin nodes if something like this happens often in your area.

Copy/paste or delete old and replace new?
There is no real difference, except that you will probably have to wait a bit longer if you do everything manually.
I don't know what operating system you use, but files are not really deleted when you simply click delete button, unless you use permanent delete option.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I use a cold wallet and run the Core to support the blockchain.
If that's the case, I assume bandwidth isn't a problem. Correct? I'd go without backups: if a power outage breaks your blocks directory, just let it sync from scratch.

Quote
I happend to have a 2TB external drive which I'm reserving just for that purpose. And yes! SHUT DOWN THE CORE before copying!
May I suggest rsync?
I use something like this:
Code:
rsync -avh --link-dest=/TimeMachine/lastbackup/ /home/loyce/.bitcoin/ /TimeMachine/newbackup
This creates hard links for all unchanged files to the last backup, and adds new files. You can keep weekly snapshots without much additional storage space.

Please fix your quotes. You'll need to manually add [ /quote] and [ quote] in between.
jr. member
Activity: 57
Merit: 62
Will copy/pasting the known good data directory to the corrupted one solve the corruption problem? Is it as simple as re-booting and starting fresh with the one exception that the new program will have to re-build to the current height?
Yes. That's how any backup works. It's probably best to shut down Bitcoin Core before you start making your backup, you shouldn't copy it while it's being written to.

IF AND WHEN that time comes, when I have to re-paste in the entire data directory (Bitcoin), I just hope that there will be no errors with permissions. Come to think of it, in Roaming I have some programs I never use. I could test one in exactly the way I would do with Bitcoin . . .

Quote
In spite of having a UPS and an AC/DC inverter for the house, I am now on IBD #3
How did that happen? For what it's worth: I prefer a laptop over the hassle of getting a UPS.

A BUNCH of stuff happened. First, I found out that the battery in my UPS was dead and not charging. I am very ambivalent about UPS's: a. You also need to connect your monitor which uses more power, b. You only have some minutes to shutdown and we can't be at our computers 24/7, c. manufacturers make it difficult or impossible to replace the battery. You are forced to re-buy and replace a perfectly good UPS. Second, after the second day of a power outage, we took the inverter to zero charge. When we re-charged it, the charge was unstable and it shut down. Lastly, I generally run Linux. I loathe Windows. I use it because I must to run graphics software for my microscope, so I use the Windows computer for my projects. Sometimes Windows shuts down improperly. It's a tremendously buggy OS.

Quote
a. Copy/paste or delete old and replace new?
When restoring a backup, I wouldn't want to keep incomplete newer block files while restoring older files. If you have enough disk space, you can rename the damaged directory before restoring your backup. If you need it again, at least you still have it.

IT OCCURS TO me that a copy/paste of new over corrupted would be a mistake. The chance for errors is to great. I do a lot of copy/pasting of music data. Sometimes the process chokes and I get an option to "skip" and continue. That could be fatal for something as precise as the blockchain. I think it'd be better to delete the old good backup and re-write using the known good . . .

Quote
b. Ditto EXCEPT do this only with the blocks subfolder?
If your wallet isn't corrupted, you shouldn't replace it. Your backup won't have the latest transaction Labels.

I DON'T USE the wallet. A CLI wallet (for me) is not the place to practice. I use a cold wallet and run the Core to support the blockchain.

Quote
the data increasing roughly every ten minutes, you would need to do a backup frequently
If you're a month behind, you'll only need to sync a few GB. If that's acceptable, you don't need very frequent backups.

TRUE. I'm thinking once a week or so. I happend to have a 2TB external drive which I'm reserving just for that purpose. And yes! SHUT DOWN THE CORE before copying!

legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
(2) If that doesn’t work, do a reindex.  Go to the Core application program in Downloads: bitcoin-22.0-win64-setup. Right click properties. Next to the Bitcoin logo you will find a writable field. Type in this flag:

. . . setup –reindex

and click Apply. I have seen instances where the flag is designated with one hypen; others with a double hypen. I think that the double hyphen is correct.
-snip-
You should edit this since "...setup" is pertaining to the installer and not the executable.
Should be:

"....\bitcoin-qt.exe" -reindex

Must be outside the quotation marks, either --reindex or -reindex will work on shortcuts.

Also, "writable field" should be specified to "Target:" under 'Shortcut' tab since there are more than one writable fields there.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Will copy/pasting the known good data directory to the corrupted one solve the corruption problem? Is it as simple as re-booting and starting fresh with the one exception that the new program will have to re-build to the current height?
Yes. That's how any backup works. It's probably best to shut down Bitcoin Core before you start making your backup, you shouldn't copy it while it's being written to.

Quote
In spite of having a UPS and an AC/DC inverter for the house, I am now on IBD #3
How did that happen? For what it's worth: I prefer a laptop over the hassle of getting a UPS.

Quote
a. Copy/paste or delete old and replace new?
When restoring a backup, I wouldn't want to keep incomplete newer block files while restoring older files. If you have enough disk space, you can rename the damaged directory before restoring your backup. If you need it again, at least you still have it.

Quote
b. Ditto EXCEPT do this only with the blocks subfolder?
If your wallet isn't corrupted, you shouldn't replace it. Your backup won't have the latest transaction Labels.

Quote
the data increasing roughly every ten minutes, you would need to do a backup frequently
If you're a month behind, you'll only need to sync a few GB. If that's acceptable, you don't need very frequent backups.

Quote
I’m most interested in finding out if a complete backup and restore is possible.
I only backup data I can't reproduce. That's my wallet.dat. Any other data I'll just download again if I have to. It would be a different story if I'd have a bandwidth limit.
jr. member
Activity: 57
Merit: 62

According to bitnodes.io  I run the only BTC Full Node (Core v22; 24/7; on Win 11 GUI) in the Dominican Republic.  In addition I also run a DAO Full Node, bisq, which recognizes and utilizes the BTC blockchain. Maybe one day I will trade on bisq IF I can figure it out! Meanwhile, I am just enjoying the technology and supporting decentralization.

As you know, the worst thing that can happen is an unintended pc shutdown (e.g. power outage) that prevents a Core shutdown and leads to various kinds of corruption.  Having to uninstall and re-start IBD from the genesis block is a major hassle tantamount to having to do a clean OS install after an irrecoverable OS crash.

In spite of having a UPS and an AC/DC inverter for the house, I am now on IBD #3, with days to go. And the Dex DAO is suspended until I can reach current block height. 5 seconds faulty Win shutdown = Disaster.

The purpose of this post is to collate Core Recovery Options. Some of the information I have gleaned from posts in this sub-forum. But I want to start a thread that puts the general recommendations in one place as well as encouraging other members to correct me and to add more information.

The context here is for OS Windows, the GUI program:

(1) After re-booting and confirming failure of the program to start, the first step is fact finding. Even though you cannot start the program, you can still inspect debug for errors. Go to the Bitcoin folder. The filepath is: C:\Users\YourName\AppData\Roaming\Bitcoin. Open the Bitcoin directory and look for debug. Click on that.

Remember that the debug file starts at the top in the past and proceeds down to the bottom in the present, so scroll down. Look for an error and/or a suggested solution, write them down, and continue. If not self-explanatory, you could copy/paste and google or c/p to this sub-forum.

(2) If that doesn’t work, do a reindex.  Go to the Core application program in Downloads: bitcoin-22.0-win64-setup. Right click properties. Next to the Bitcoin logo you will find a writable field. Type in this flag:

. . . setup –reindex

and click Apply. I have seen instances where the flag is designated with one hypen; others with a double hypen. I think that the double hyphen is correct.

(3) Another option, and it is one I’m most unsure about, is a backup of the entire core data directory which then enables a replacement of the corrupted directory with a known good one.

This is the filepath to the directory:

C:\Users\MyName\AppData\Roaming\Bitcoin\blocks
The data directory is Bitcoin and it includes the subfolder blocks.

I have copy/pasted Bitcoin to an external drive. The question is:

Will copy/pasting the known good data directory to the corrupted one solve the corruption problem? Is it as simple as re-booting and starting fresh with the one exception that the new program will have to re-build to the current height?

Some thoughts:

a. Copy/paste or delete old and replace new?
b. Ditto EXCEPT do this only with the blocks subfolder?
c. Since the contents of the data directory are dynamic, the data increasing roughly every ten minutes, you would need to do a backup frequently. It could be that a copy/paste of new over old will replace extant files and add new.

Based on your responses, I’m most interested in finding out if a complete backup and restore is possible.


















Jump to: