importing all blkXXXXXX.dat

7

3

I've moved my bitcoind process to a new server, I made a backup of my .bitcoin folder (I'm using linux). I would really like to avoid downloading the whole blockchain again.

What's the right way to import all the blk00000.dat files? Is it enough to move the .bitcoin folder over the new one?

EDIT: I see the Loadblock option but I suppose I should run it after move the file outside.Anyone can confirm this? Is there a better way?

Dan

Posted 2013-09-10T20:02:26.830

Reputation: 173

Unfortunately, I don't know that myself, but these questions cover similar topics and might help: 1, 2, 3, 4

Murch 2013-09-19T15:53:13.927

Have you tried --rescan?KJ O 2013-10-19T19:30:19.923

1-rescan is for finding missing wallet transactions in your existing block chain. It doesn't affect the blockchain itself.Pieter Wuille 2013-10-20T11:49:39.040

Answers

2

I've just posted this in response to another question, but will post again as using bootstrap.dat is by far the best way to get a node up and running.

If you are downloading the blockchain from scratch I strongly recommend using the bootstrap.dat file, which allows your computer to simply verify blocks and import them without needing to download for days or even weeks on end.

The main issue with downloading from the network is that your client will only download one block at a time. It starts with block #1 and will not try to download anything except for block #2 after block #1 is verified, and so on. As you can imagine, with network latency this can become a rather painful process, as you have endured.

The bootstrap.dat file is widely available on bittorrent, torrent files can be found here: http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/

Direct torrent link: http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/bootstrap.dat.torrent/download

Downloading the bootstrap.dat file is just as secure as downloading the blockchain from peers, but since all the data is already there, the only latency you suffer between blocks is going to your hard drive and finding the next block.

You simply need to place the bootstrap.dat in your %appdata%\Bitcoin folder, (on linux/unix in your .bitcoin folder) the file will be renamed bootstrap.dat.old when the data import is complete. Using this it took me only 4 hours to catch up with the network, as opposed to the 1-2 weeks it took me before reformatting on the same computer.

Mark

Posted 2013-09-10T20:02:26.830

Reputation: 1 647

1Technical tidbit here, the bootstrap.dat file is actually just a concatenation of the blkXXXXX.dat files. You can literally build your own bootstrap.dat by doing something like cat blk*.dat >~/bootstrap.datJimmy Song 2015-02-04T21:12:39.540

2

Copy these files to a exact Bitcoin Data folder on your Ubuntu (~/.bitcoin/) and then run client to download the latest blocks available. To synchronize with the blockchain run bitcoind with command -reindex bitcoind -reindex.

Marek

Posted 2013-09-10T20:02:26.830

Reputation: 819

0

On the Windows, I just replaced the directories and it worked fine.

Eyal

Posted 2013-09-10T20:02:26.830

Reputation: 1 539

Thanks, under linux seems to cause some issues. I'm using bitcoind, not bitcoin-qt but I don't think there are any differences.Dan 2013-09-19T17:42:19.903

It should work if you copy the blocks and chainstate directories. You should also copy wallet.dat if you want to keep your old wallet.ScripterRon 2013-12-18T19:22:18.617

0

If you are not changing the program as such, you should be able to place the blockchain into the same folder as the original. We do this quite successfully in Windows. We have also (for other currencies) zipped up a blockchain and had it downloaded onto a client which had sync problems - in order to fix the problem. Similarly it should work the same way for Linux.

John Lowe

Posted 2013-09-10T20:02:26.830

Reputation: 29

I would strongly recommend using bootstrap.dat or creating your own as described here: http://bitcoin.stackexchange.com/questions/18568/how-do-you-generate-a-bootstrap-dat-file

Mark 2014-01-31T17:26:14.703