Bitcoin Forum
April 19, 2024, 12:32:28 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: backup of the index  (Read 651 times)
merlinsilk (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
April 01, 2016, 05:25:39 PM
 #1

I had another crash of my windows 8.1 machine which I run bitcoin core on - and that took down my index - - again.
Now after a night of the fan going full speed I am still 37 weeks out of date.
There must be a way to back up that work!
Would it be possible to have a back-up of the index and restore it after a crash that corrupts the index? A copy of a few GB should be faster than hours and hours of reindexing.
Or is there a reason why that should/would not work?
If it is possible would I have to shut down core before backing up the index to make sure no files are open that might not be backed up or could I use shadow copy to do that (or would I end up with a corrupted index after restoring a snapshot that core does not know what to do with)?
Thanks - Merlin
1713486748
Hero Member
*
Offline Offline

Posts: 1713486748

View Profile Personal Message (Offline)

Ignore
1713486748
Reply with quote  #2

1713486748
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713486748
Hero Member
*
Offline Offline

Posts: 1713486748

View Profile Personal Message (Offline)

Ignore
1713486748
Reply with quote  #2

1713486748
Report to moderator
1713486748
Hero Member
*
Offline Offline

Posts: 1713486748

View Profile Personal Message (Offline)

Ignore
1713486748
Reply with quote  #2

1713486748
Report to moderator
1713486748
Hero Member
*
Offline Offline

Posts: 1713486748

View Profile Personal Message (Offline)

Ignore
1713486748
Reply with quote  #2

1713486748
Report to moderator
--Encrypted--
Copper Member
Legendary
*
Offline Offline

Activity: 924
Merit: 1007

hee-ho.


View Profile
April 01, 2016, 06:03:54 PM
 #2

you can back up anything in the blocks folder including the index folder and load it later if your files get corrupted.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6505


Just writing some code


View Profile WWW
April 01, 2016, 07:11:46 PM
 #3

I had another crash of my windows 8.1 machine which I run uᴉoɔʇᴉq core on - and that took down my index - - again.
Now after a night of the fan going full speed I am still 37 weeks out of date.
There must be a way to back up that work!
Would it be possible to have a back-up of the index and restore it after a crash that corrupts the index? A copy of a few GB should be faster than hours and hours of reindexing.
Or is there a reason why that should/would not work?
If it is possible would I have to shut down core before backing up the index to make sure no files are open that might not be backed up or could I use shadow copy to do that (or would I end up with a corrupted index after restoring a snapshot that core does not know what to do with)?
Thanks - Merlin
Of course. You need to go to the data directory and and find the blocks, chainstate, and database folders. These you need to backup. Copy them somewhere safe. However, these folders are not just "a couple of Gb" but rather 60+ Gb. You will need a hard drive that can store this full backup (because you will need all of it) and the original. Whenever you need to reindex, you can just copy those three folders back to the data directory. Keep in mind that this will set your sync state to the same as when you made that backup so you will need to wait a little bit for Bitcoin Core to catch up. If you want to keep the catch up fast, then you should make those backups routinely.

Also, I advise that you upgrade to Bitcoin Core 0.12.0 if you have not already. This version has fixes which makes it not necessary to reindex on a crash. You shouldn't need to reindex every time it crashes with this latest version.

cr1776
Legendary
*
Offline Offline

Activity: 4004
Merit: 1299


View Profile
April 01, 2016, 07:29:48 PM
 #4

I had another crash of my windows 8.1 machine which I run uᴉoɔʇᴉq core on - and that took down my index - - again.
Now after a night of the fan going full speed I am still 37 weeks out of date.
There must be a way to back up that work!
Would it be possible to have a back-up of the index and restore it after a crash that corrupts the index? A copy of a few GB should be faster than hours and hours of reindexing.
Or is there a reason why that should/would not work?
If it is possible would I have to shut down core before backing up the index to make sure no files are open that might not be backed up or could I use shadow copy to do that (or would I end up with a corrupted index after restoring a snapshot that core does not know what to do with)?
Thanks - Merlin
Of course. You need to go to the data directory and and find the blocks, chainstate, and database folders. These you need to backup. Copy them somewhere safe. However, these folders are not just "a couple of Gb" but rather 60+ Gb. You will need a hard drive that can store this full backup (because you will need all of it) and the original. Whenever you need to reindex, you can just copy those three folders back to the data directory. Keep in mind that this will set your sync state to the same as when you made that backup so you will need to wait a little bit for uᴉoɔʇᴉq Core to catch up. If you want to keep the catch up fast, then you should make those backups routinely.

Also, I advise that you upgrade to uᴉoɔʇᴉq Core 0.12.0 if you have not already. This version has fixes which makes it not necessary to reindex on a crash. You shouldn't need to reindex every time it crashes with this latest version.

It is also probably advisable to shutdown Core prior to backing it up.

merlinsilk (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
April 01, 2016, 07:35:37 PM
 #5

do you know if Core keeps files open that it works with or only opens them if needed?
Depending on that I would have to close down Core before I make a backup - thinking about every week or few days to minimize the reindexing time.
And, yes, I just upgraded to 0.12 so hopefully that will not be a big issue any more. I actually do backup the whole database daily already (robocopy so I don't have to copy the whole thing - only changes), unfortunately I did not think of that yesterday, so that backup was overwritten with the 2 years out of sync  :-(
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3374
Merit: 6505


Just writing some code


View Profile WWW
April 01, 2016, 07:51:07 PM
 #6

do you know if Core keeps files open that it works with or only opens them if needed?
Depending on that I would have to close down Core before I make a backup - thinking about every week or few days to minimize the reindexing time.
And, yes, I just upgraded to 0.12 so hopefully that will not be a big issue any more. I actually do backup the whole database daily already (robocopy so I don't have to copy the whole thing - only changes), unfortunately I did not think of that yesterday, so that backup was overwritten with the 2 years out of sync  :-(
I think the files are constantly open. It is probably a good idea to have Core shut down when you do the backups and when you restore.

merlinsilk (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
April 02, 2016, 12:41:58 AM
 #7

thanks!
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!