Author

Topic: Copied blockchain from Windows to Linux, redownloading everything again? (Read 1389 times)

legendary
Activity: 1078
Merit: 1024
I hate when people post problems so I always like to come back when I figure things out.

Just for information, I can confirm that copying the complete blocks directory and the chainstate, the blockchain was not redownloaded and only the blocks between last shutdown to the latest were downloaded.

It does work, but it feels to me that every time I've done something similar (importing my blockchain along with everything else after a reformat or another computer), something goes wrong and my wallet client is corrupted/slow/buggy.
Having unlimited bandwidth and a lot of spare time, I usually prefer doing a clean install.
legendary
Activity: 2576
Merit: 2267
1RichyTrEwPYjZSeAYxeiFBNnKC9UjC5k
I hate when people post problems so I always like to come back when I figure things out.

Just for information, I can confirm that copying the complete blocks directory and the chainstate, the blockchain was not redownloaded and only the blocks between last shutdown to the latest were downloaded.
legendary
Activity: 2576
Merit: 2267
1RichyTrEwPYjZSeAYxeiFBNnKC9UjC5k
Weird. Was like that for a while on "5 days behind" then I restarted, jumped to "3 days behind" but no network traffic at all also no response on debug console. Then restarted and got stuck on "loading wallet" then rebooted whole computer and it stuck on "Rescan... 100%" for 5 minutes and when it finally started, I was only 5 hours behind and now I'm caught up.

Just plain odd. I appear to be caught up and good now.

Will play more with the copying to Linux tomorrow.

I guess maybe I was actually caught up but the bitcoind part was still busy with something so wasn't updating the GUI or something odd.
legendary
Activity: 2576
Merit: 2267
1RichyTrEwPYjZSeAYxeiFBNnKC9UjC5k
Hmm. Had no inbound ports open for the windows client. Let's see if that helps.
legendary
Activity: 2576
Merit: 2267
1RichyTrEwPYjZSeAYxeiFBNnKC9UjC5k
Opening a file simply for reading should update its access time but not its modify time in linux.

Code:
~/.bitcoin$ stat blocks/blk00001.dat
  File: 'blocks/blk00001.dat'
  Size: 134174148       Blocks: 262328     IO Block: 4096   regular file
Device: fd05h/64773d    Inode: 10493965    Links: 1
Access: (0744/-rwxr--r--)  Uid: ( 1000/    rich)   Gid: (  100/   users)
Access: 2015-07-08 22:16:36.913205675 -0500
Modify: 2015-07-08 22:16:33.403205785 -0500
Change: 2015-07-08 22:16:33.403205785 -0500
 Birth: -
legendary
Activity: 2576
Merit: 2267
1RichyTrEwPYjZSeAYxeiFBNnKC9UjC5k
Hmm, for some reason on my windows client, it looks like my peers have decided to starve me of data.

staff
Activity: 3458
Merit: 6793
Just writing some code
I'm not so sure since those timestamps show the files being modified. Bandwidth was taking a hit too but it's possible that that was just because I quit my client a few days ago.

It's looking like I probably need to copy the whole of the blocks directory and the chainstate directory too. I'll give that a go and see how it works out.

Worst case, I should probably be able to just tell the bitcoind on linux to use my windows node as a peer and get the blocks that way.
The timestamps modify because it is reading from each file and the act of opening and reading a file will modify its timestamp. It needs to read the blk files in order to build the other leveldb files.
legendary
Activity: 2576
Merit: 2267
1RichyTrEwPYjZSeAYxeiFBNnKC9UjC5k
I'm not so sure since those timestamps show the files being modified. Bandwidth was taking a hit too but it's possible that that was just because I quit my client a few days ago.

It's looking like I probably need to copy the whole of the blocks directory and the chainstate directory too. I'll give that a go and see how it works out.

Worst case, I should probably be able to just tell the bitcoind on linux to use my windows node as a peer and get the blocks that way.
staff
Activity: 3458
Merit: 6793
Just writing some code
It isn't redownloading, it is reindexing the blockchain. It doesn't take as long to reindex everything. I have run into this problem before. For some reason, Bitcoin Core doesn't recognize the databases from windows and vice versa. Just let it reindex the block chain, it will take considerably less time than a redownload since you already have the raw block files, it just needs to rebuild the databases it uses.
legendary
Activity: 2576
Merit: 2267
1RichyTrEwPYjZSeAYxeiFBNnKC9UjC5k
I have a bitchain-qt (0.10.1) which I have been running on Windows with an (fairly) up-to-date blockchain. I have some dev work I'd like to do on Linux (and for which a new wallet would be a good idea anyway) so I downloaded the latest (0.10.2), ran it to create the directories then copied rev*.dat and blk*.dat to a new directory and symlinked the blocks directory in ~/.bitcoin to that thinking that bitcoind would recognize the files and I could avoid having to redownload everything.

The problem is, it's still redownloading everything. It's even overwriting the files so I know it's not that I have some weird directory thing going on. Did I miss a step?

This is what an ls -lrt looks like when I run it on the directory. It's started redownloading right from the beginning...

Code:
[...]
-rwxr--r-- 1 user1 users   67108864 Jul  3 12:46 blk00244.dat*
-rwxr--r-- 1 user1 users    7340032 Jul  3 12:46 rev00244.dat*
-rwxr--r-- 1 user1 users  134214302 Jul  8 16:41 blk00000.dat*
-rwxr--r-- 1 user1 users   19922944 Jul  8 16:41 rev00000.dat*
drwx------ 2 user1 users       4096 Jul  8 22:16 index/
-rwxr--r-- 1 user1 users  134174148 Jul  8 22:16 blk00001.dat*
-rwxr--r-- 1 user1 users   16777216 Jul  8 22:16 rev00001.dat*
-rwxr--r-- 1 user1 users  265289728 Jul  8 22:18 rev00002.dat*
-rwxr--r-- 1 user1 users 2097439789 Jul  8 22:18 blk00002.dat*


If I'm just missing a something, could someone point me at a tutorial?

Note that I'm not worried about having to reindex, just don't see the point of burning bandwidth when I already have the data.
Jump to: