https://i.imgur.com/03xJ3ge.jpg?1We all hate resyncs, no matter what you use Bitcoin Core for, Running an exchange, P2Pool, Trading... Resyncs will always make you loose time and maybe even money!
The most reasonable and easy way to prevent a resync is to create a security copy of the blockchain and the database. So if your database is corrupted right now, and you don't have a security copy, there is no (worth) way to skip a resync. However the blockchain is continuously getting updated with new blocks and transactions so you will have to create a new security copy each X time period. The problem is that you probably can't afford to loose time making those copies, so this guide will show you how to use FileHistory, a native Windows tool which will allow you to tell windows to create copies of the folders you choose into a external memory each X time.
For this you will need:
- A system with Windows 8, Windows 8.1 or Windows 10
- A external hard drive with enough space to hold several copies of the blockchain
If you don't have a system with the mentioned OS you can use a third-party security copy tool.
Footage is from a sapnish Windows 10 system. If you use Windows 8, process might be slightly different. Button names are in spanish, if you don't understand spanish, take the button place as reference.
How To Create Copies1. To start you will need to open system configuration (
https://i.imgur.com/1sEL3Bi.png?1)
2. Once there select "Update and Security" (
https://i.imgur.com/7RCee1G.png)
3. Select the "Security Copy" tab (
https://i.imgur.com/T6UfYHk.png)
4. Enable the switch button. You will be asked which location do you want to use to store copies, choose your external hard drive. (
https://i.imgur.com/i80Ap6x.png)
5. Click "More Options" (
https://i.imgur.com/iKjDnto.png)
6. In that screen you will see more options like each how many time a copy should be created, when should old copies get deleted... And which folders should get copied.
7. Click the "Add a folder" button (
https://i.imgur.com/3tI6SVH.png) And select the bitcoin data directory (
https://i.imgur.com/W7O8Dgi.png) Now you're here, select any other important folder you would like to get copied.
Done. Now your system should run security copies periodically in the background.
How To Restore a CopyIf you get your database corrupted, but fortunately you followed the "How to create copies" steps, not everything is lost, you can restore it! It's quickier than resyncing all the blockchain.
1. Find your bitcoin data directory.
2. Right click on it and select properties.
3. Select the "Previous Versions" tab (
https://i.imgur.com/C1skErG.png).
You may find something like this instead
https://i.imgur.com/rrf1wpl.png. If you get this, follow steps from 1 to 4 from "How to create copies" and then scroll the page down. There you will find "Restore Files from an Actual Security Copy" click it, a restore window will open, close the window and try again step 2 and 3
4. Find the last working security copy.
5. Select it and click restore.
Now it should start making a file copy operation. If you get prompted about what to do with dupe files choose to override the ones in the destination folder. Depending on how good is your computer, your hard drive, etc... it will take between half an hour or 2 hours to restore.
WARNING: Restoring a copy will delete all addresses and metadata which were created after the security copy you have choosen to restore. Be carefull about this.