Author

Topic: bitcoin-qt: Move Downloaded blockchain to another installation (Read 14389 times)

hero member
Activity: 900
Merit: 1014
advocate of a cryptographic attack on the globe
Thanks, this was helpful information.
newbie
Activity: 22
Merit: 0
It has also been reported that the new leveldb database format is not as portable, i.e. a datadir created on Linux might not work on Windows.
I had even replied to that comment 5 days ago asking for any further details from you or the community: https://bitcointalksearch.org/topic/m.1670599

Quote
Thanks for the info, deepceleron. Do you know if it is possible to copy the 0.8 blockchain to a new computer by simply pasting the blocks and chainstate directories? Any further info on whether such a transfer would work cross-platform or not?
Sadly, apparently no one here knew the correct answer or could be bothered to share it. I decided to try my best to find out and share the answer so that others could benefit. With the blockchain well over 7.5GB and growing fast, it is important that users know how to copy the blockchain correctly.
legendary
Activity: 1512
Merit: 1036
Unable to find a definitive answer to the question of copying the blockchain to another computer, I asked Gavin via email:

In Bitcoin-Qt 0.8+, how can the blockchain be copied from one computer to another? Is it simply a matter of copying the blocks and chainstate directories?

His reply:

Yes

That is appropriately curt. You feel entitled to bother a lead developer for your own personal tech support? I have a feeling this is one reason why Satoshi was no longer entertained with the forum.
newbie
Activity: 22
Merit: 0
Thanks very much for confirming that, Matt!
member
Activity: 105
Merit: 10
Hello All,

I can confirm that it is possible to copy the block chain from a Windows v0.8.1-beta installation to a linux v0.8.1-beta by copying only the contents (including subdirectories) of 'blocks' and 'chainstate' folders.

Matt
newbie
Activity: 22
Merit: 0
Quote
Basically just make a copy of the whole Bitcoin data directory and drop it into any computer
For 0.8+, you may want to skip at least the deprecated blkxxxx.dat and blkindex.dat files since they are no longer used and are quite large. More on the data directory contents: https://en.bitcoin.it/wiki/Data_directory
newbie
Activity: 18
Merit: 0
Unable to find a definitive answer to the question of copying the blockchain to another computer, I asked Gavin via email:

In Bitcoin-Qt 0.8+, how can the blockchain be copied from one computer to another? Is it simply a matter of copying the blocks and chainstate directories?

His reply:

Yes
That's right. I posted on this here:
https://bitcointalksearch.org/topic/m.1680307

Basically just make a copy of the whole Bitcoin data directory and drop it into any computer with the Bitcoin-Qt client installed on it. Make sure the client is not running and replace the existing directory with the copy.
BE CAREFUL NOT TO ERASE ANY WALLET THAT MAY HAVE VALUE!
newbie
Activity: 22
Merit: 0
Unable to find a definitive answer to the question of copying the blockchain to another computer, I asked Gavin via email:

In Bitcoin-Qt 0.8+, how can the blockchain be copied from one computer to another? Is it simply a matter of copying the blocks and chainstate directories?

His reply:

Yes
newbie
Activity: 18
Merit: 0
If you wanted to change the default location, one way would be to use a symlink. I had to do this for the iMovie data directory years ago:

http://tinyapps.org/blog/mac/200805230700_change_imovie_save_directory.html
Of course! Thanks.
newbie
Activity: 22
Merit: 0
Quote
Does anyone have any idea how to change the default data directory on a Mac?

Just put the files in the default location:

~/Library/Application Support/Bitcoin

The tilde (~) represents the root directory of your home folder. The full path would look something like:

/Users/username/Library/Application Support/Bitcoin

If you wanted to change the default location, one way would be to use a symlink. I had to do this for the iMovie data directory years ago:

http://tinyapps.org/blog/mac/200805230700_change_imovie_save_directory.html
newbie
Activity: 18
Merit: 0
On my side (WinXP), data directory is on D: drive, folder BitcoinData, so "Target" field for shortcut is:

"C:\Program Files\Bitcoin\bitcoin-qt.exe" -datadir=D:\BitcoinData
Does anyone have any idea how to change the default data directory on a Mac? I'm not aware of a "Target" parameter when launching apps in OS X. I've tried googling it but come up with nothing.
full member
Activity: 238
Merit: 100
In Gord We Trust
Quote
Which files do I need? Are blk0001.dat, blk0002.dat and blkindex.dat enough?
It seems that in 0.8.1 those have been superceded by two new directories: blocks and chainstate. There is a third directory named "database", but I dimly recall that being present in previous versions as well.

As of 3/23/13, those three directories contain about 7.76GB of data, with blocks making up 7.57GB of that total.

Is copying the blockchain to a new machine as simple as pasting one or more of these directories? Is there any reason to keep blk0001.dat, blk0002.dat and blkindex.dat?

I would also be interested in the steps needed for moving the blockchain around in 0.8.1. Any helpers out there?
newbie
Activity: 22
Merit: 0
Quote
Which files do I need? Are blk0001.dat, blk0002.dat and blkindex.dat enough?
It seems that in 0.8.1 those have been superceded by two new directories: blocks and chainstate. There is a third directory named "database", but I dimly recall that being present in previous versions as well.

As of 3/23/13, those three directories contain about 7.76GB of data, with blocks making up 7.57GB of that total.

Is copying the blockchain to a new machine as simple as pasting one or more of these directories? Is there any reason to keep blk0001.dat, blk0002.dat and blkindex.dat?
hero member
Activity: 756
Merit: 501
There is more to Bitcoin than bitcoins.
I moved my bitcoin-qt.exe to my external drive E:\ and just dumped the blockchain files into that same directory on E:\ as well.  However, whenever I run bitcoin-qt.exe -detachdb, it keeps re-creating C:\Mousepotato\Appdata\Roaming\Bitcoin and starts downloading the blockchain again.  What am I doing wrong?
You should have detached the databases before moving the files. Once you have them moved, the option is no longer needed.
hero member
Activity: 896
Merit: 1000
Seal Cub Clubbing Club
You need to run bitcoin with the command "-datadir E:\" change the path to wherever you want your bitcoin directory to be.

Thank you!
hero member
Activity: 533
Merit: 500
^Bitcoin Library of Congress.
You need to run bitcoin with the command "-datadir E:\" change the path to wherever you want your bitcoin directory to be.
hero member
Activity: 896
Merit: 1000
Seal Cub Clubbing Club
I moved my bitcoin-qt.exe to my external drive E:\ and just dumped the blockchain files into that same directory on E:\ as well.  However, whenever I run bitcoin-qt.exe -detachdb, it keeps re-creating C:\Mousepotato\Appdata\Roaming\Bitcoin and starts downloading the blockchain again.  What am I doing wrong?
hero member
Activity: 533
Merit: 500
^Bitcoin Library of Congress.
This is a newbie question...

I've installed bitcoin-qt and Armoury on on a PC. After ages, (more than 8 hours) the blockchain is still downloading. (Last received block generated 175 days ago).
Instead of going through the same rigmarole again on another PC, can I install bitcoin-qt, and move the files from C:\Users\USERNAME\AppData\Roaming\Bitcoin to the new installation?

Which files do I need?
Are blk0001.dat, blk0002.dat and blkindex.dat enough? (I don't need to move my wallet.dat)

Can they just be "dropped into place", or is there a command line option I need to use to make it recognised?

Many Thanks!
Yes, blk0001.dat, blk0002.dat and blkindex.dat are enough. (Unless there is a new blk0003.dat then you need it to.)
Before moving any files start both the bitcoin-qt clients, go to options, and check the box which says detach database at shutdown.  Then close both clients. (Make sure they are closed in taskmanager.) then you are free to move the block chain files.

P.S. You can start the bitcoin clients with the command option -detachdb to accomplish the same thing as checking the box.
P.S. After the files are successfully imported you may want to deselect the detach database at shutdown to speed up the shut down of the bitcoin-qt clients.

for?  reindexing?  unless you have 8GB RAM for a ramdrive or less than 10Mbps downstream, it'd be quicker to DL
No, when you check detach database at shutdown it allows the bitcoin-qt client to accept the new blockchain without errors.  It does NOT have to index the blockchain, it simply loads the blockchain files on startup like it would its own.  This is infinity faster than updating the blockchain from DL.

P.S. I may not have been clear in may previous post.  When you move the blockchain files, you move them to the bitcoin directory and REPLACE the other blockchain files.  You do NOT run the client so that is updates its blockchain files from the new ones.
newbie
Activity: 19
Merit: 0
Thanks everyone for your help!
In the end, I installed v0.8 and then re-downloaded the Blockchain from scratch using the -dbcache=2000 parameter. This was much quicker than on the previous version of bitcoin-qt. Unfortunately, it and Armory takes up a lot of RAM though!
zvs
legendary
Activity: 1680
Merit: 1000
https://web.archive.org/web/*/nogleg.com
This is a newbie question...

I've installed bitcoin-qt and Armoury on on a PC. After ages, (more than 8 hours) the blockchain is still downloading. (Last received block generated 175 days ago).
Instead of going through the same rigmarole again on another PC, can I install bitcoin-qt, and move the files from C:\Users\USERNAME\AppData\Roaming\Bitcoin to the new installation?

Which files do I need?
Are blk0001.dat, blk0002.dat and blkindex.dat enough? (I don't need to move my wallet.dat)

Can they just be "dropped into place", or is there a command line option I need to use to make it recognised?

Many Thanks!
Yes, blk0001.dat, blk0002.dat and blkindex.dat are enough. (Unless there is a new blk0003.dat then you need it to.)
Before moving any files start both the bitcoin-qt clients, go to options, and check the box which says detach database at shutdown.  Then close both clients. (Make sure they are closed in taskmanager.) then you are free to move the block chain files.

P.S. You can start the bitcoin clients with the command option -detachdb to accomplish the same thing as checking the box.
P.S. After the files are successfully imported you may want to deselect the detach database at shutdown to speed up the shut down of the bitcoin-qt clients.

for?  reindexing?  unless you have 8GB RAM for a ramdrive or less than 10Mbps downstream, it'd be quicker to DL
hero member
Activity: 533
Merit: 500
^Bitcoin Library of Congress.
This is a newbie question...

I've installed bitcoin-qt and Armoury on on a PC. After ages, (more than 8 hours) the blockchain is still downloading. (Last received block generated 175 days ago).
Instead of going through the same rigmarole again on another PC, can I install bitcoin-qt, and move the files from C:\Users\USERNAME\AppData\Roaming\Bitcoin to the new installation?

Which files do I need?
Are blk0001.dat, blk0002.dat and blkindex.dat enough? (I don't need to move my wallet.dat)

Can they just be "dropped into place", or is there a command line option I need to use to make it recognised?

Many Thanks!
Yes, blk0001.dat, blk0002.dat and blkindex.dat are enough. (Unless there is a new blk0003.dat then you need it to.)
Before moving any files start both the bitcoin-qt clients, go to options, and check the box which says detach database at shutdown.  Then close both clients. (Make sure they are closed in taskmanager.) then you are free to move the block chain files.

P.S. You can start the bitcoin clients with the command option -detachdb to accomplish the same thing as checking the box.
P.S. After the files are successfully imported you may want to deselect the detach database at shutdown to speed up the shut down of the bitcoin-qt clients.
zvs
legendary
Activity: 1680
Merit: 1000
https://web.archive.org/web/*/nogleg.com
Hi Akka,
Thanks for your help!
I'm using v0.7.2-beta... when did v0.8 come out?

Can I still transpant the files over to 0.8?

Kind Regards.

i have a 7z of 0.8 reorganization @ http://www.nogleg.com/archive/v0.8.0-Feb-11th/v0.8.0-Feb-11th.7z   goes up to block 220800 or so..  it isn't "pruned", so it's just as big as before, but in a diff format

and then you'd delete everything but bitcoin.conf & wallet.dat, then use that for 0.8 rc

aha
legendary
Activity: 1072
Merit: 1181
v0.8.0 is not released yet, there's only a release candidate.
legendary
Activity: 1232
Merit: 1001
I'm using v0.7.2-beta... when did v0.8 come out?

3 days ago, so it's brand new.

Can I still transpant the files over to 0.8?

Kind Regards.

Yes and no, 0.8 needs to convert the files to the new format. If you are not finished downloading anyway, I would let it start new.
newbie
Activity: 19
Merit: 0
Hi Akka,
Thanks for your help!
I'm using v0.7.2-beta... when did v0.8 come out?

Can I still transpant the files over to 0.8?

Kind Regards.
legendary
Activity: 1232
Merit: 1001
Yes, that are the files you need, just copying the should be sufficient. But as you are not finished yet anyway, I would suggest, that you upgrade to v0.8 instead.

This Version uses ultraprune and reduces the download time for the blockchain to a few hours.

The final version is not out yet, but you can download the release candidate here: https://bitcointalksearch.org/topic/bitcoin-qt-bitcoind-version-080-release-candidate-1-142151
newbie
Activity: 19
Merit: 0
This is a newbie question...

I've installed bitcoin-qt and Armoury on on a PC. After ages, (more than 8 hours) the blockchain is still downloading. (Last received block generated 175 days ago).
Instead of going through the same rigmarole again on another PC, can I install bitcoin-qt, and move the files from C:\Users\USERNAME\AppData\Roaming\Bitcoin to the new installation?

Which files do I need?
Are blk0001.dat, blk0002.dat and blkindex.dat enough? (I don't need to move my wallet.dat)

Can they just be "dropped into place", or is there a command line option I need to use to make it recognised?

Many Thanks!
Jump to: