<blockquote>
<p><strong>How can I get [the current version] to use the blockchain data which is already on my machine from [prior versions]</strong></p>
</blockquote>
<p>I believe the appropriate process is something like this:</p>
<ol>
<li>Close bitcoin-qt, bitcoind etc. Make backups. Check backups.</li>
<li>Locate the Blockchain data.
E.g <code>sudo find / -name blk00000.dat</code></li>
<li>Configure Bitcoin Core to use that location. <code>vi $HOME/.bitcoin/bitcoin.conf</code> if directory isn't in default location where bitcoin looks. See <a href="https://bitcoin.stackexchange.com/q/93403/13866"><code>datadir</code></a> and <code>walletdir</code></li>
<li>If needed, <a href="https://bitcoin.stackexchange.com/q/3449/13866">move a copy of important <code>wallet.dat</code> to appropriate location</a>. See <a href="https://bitcoin.stackexchange.com/search?q=location+wallet.dat">existing guidance</a>.</li>
</ol>
<hr />
<p>For comparison, here is the response for <code>getblockchaininfo</code> on a Bitcoin node that hasn't been run for 6 months on a PC that has inadequate resources (100% disk usage)</p>
<pre><code>{
  &quot;chain&quot;: &quot;main&quot;,
  &quot;blocks&quot;: 849345,
  &quot;headers&quot;: 869149,
  &quot;bestblockhash&quot;: &quot;0000000000000000000090dd75955aeb49fb6a51f259f3d6ee3c9639ce241ced&quot;,
  &quot;difficulty&quot;: 83675262295059.91,
  &quot;time&quot;: 1719257861,
  &quot;mediantime&quot;: 1719254246,
  &quot;verificationprogress&quot;: 0.9679465468853898,
  &quot;initialblockdownload&quot;: true,
  &quot;chainwork&quot;: &quot;0000000000000000000000000000000000000000803db1ef35254b7ce5b55f8a&quot;,
  &quot;size_on_disk&quot;: 660000239919,
  &quot;pruned&quot;: false,
  &quot;warnings&quot;: &quot;&quot;
}
</code></pre>
<p>I think a key thing here is the number of <code>blocks</code> the program knows of.</p>
<p>This PC has a <code>blocks</code> folder with about 615 GB of data in it and a <code>chainstate</code> folder with under 12 GB of data in it.</p>
<p>Your equivalent information does support your conclusion that the program isn't seeing all your data. Maybe it has logged a reason why it isn't using all the data (e.g. some error message concerning a block file?)</p>
<p>In the file <code>debug.log</code> I see</p>
<pre><code>2024-11-05T18:22:16Z Bitcoin Core version v24.0.1 (release build)
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -&gt; setting -upnp=0
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -&gt; setting -natpmp=0
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -&gt; setting -discover=0
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -&gt; setting -listenonion=0
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -&gt; setting -i2pacceptincoming=0
...
2024-11-05T18:22:25Z Default data directory XXXXXXX/Bitcoin
2024-11-05T18:22:25Z Using data directory XXXXXXX/Bitcoin
2024-11-05T18:22:25Z Config file: XXXXXXX/Bitcoin\bitcoin.conf
...
2024-11-05T18:22:47Z LoadBlockIndexDB: last block file = 4309
2024-11-05T18:22:48Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=84, size=126890608, heights=845620...845702, time=2024-05-29...2024-05-29)
2024-11-05T18:22:48Z Checking all blk files are present...
...
</code></pre>
<p>Note the last few lines above. You'll have to search for the latest occurrence of these to check that the program is actually looking in the place you instructed.</p>
<p>Your <code>debug.log</code> should show you where Bitcoin core thinks your data is located and this should help you work out what is happening.</p>
<p>There may be other error messages earlier in the debug.log that explain why the program needed to do what it is doing.</p>

CC BY-SA 4.0
2024-11-05T14:16:49.897Z
I ran `sudo find / -name blk00000.dat` and it found the data directory in home/mickin/.bitcoin/blocks/blk00000.dat
Eoin
CC BY-SA 4.0
2024-11-05T14:36:31.497Z
How many blk*.dat files are in there and what are their creation dates? If that is the only directory containing a blk00000.dat and few other blk0*.dat all dated recently, it means your original block data has perhaps all been deleted or was originally elsewhere (perhaps on a drive since removed/disconnected/unplugged)
RedGrittyBrick
CC BY-SA 4.0
2024-11-05T17:00:35.957Z
There are 4216 blk*.dat files in home/.bitcoin/blocks. There are also 4216 rev.dat files in the folder. These files were all last modified since between 31 Mar and 16 May of this year. I did not delete any block data and did not use any other drives.
Eoin
CC BY-SA 4.0
2024-11-05T17:02:15.767Z
When I scan my HDD it says that i am using 590GB of my HDD storage.
Eoin
CC BY-SA 4.0
2024-11-05T19:50:59.193Z
What does the GUI status bar say? (e.g. "Synchronising Headers (99.9%), 5 weeks behind") and in Window/Console, the CLI or using RPC API, what is the response to command `getblockchaininfo`?
RedGrittyBrick
CC BY-SA 4.0
2024-11-06T11:31:30.923Z
The GUI status bar says: Number of Blocks left: Unknown. Synching headers (241603, 28.7%)...       Last block time Sat Apr 6 3013                 Progress 1.46%
Eoin
CC BY-SA 4.0
2024-11-06T11:31:40.687Z
mickin@mickin-IdeaPad-3-15IAU7:~$ bitcoin-cli getblockchaininfo
{
  "chain": "main",
  "blocks": 237023,
  "headers": 241603,
  "bestblockhash": "000000000000002a9ea9139b011c1643d65fc5dca4af9c87bd09ad3d29c4025c",
  "difficulty": 11187257.46136079,
  "time": 1369030450,
  "mediantime": 1369026380,
  "verificationprogress": 0.0165687083236199,
  "initialblockdownload": true,
  "chainwork": "0000000000000000000000000000000000000000000000439abfc36db3cce000",
  "size_on_disk": 10021451300,
  "pruned": false,
  "warnings": ""
}
Eoin
CC BY-SA 4.0
2024-11-06T16:40:30.093Z
I added that info to your question.
RedGrittyBrick
CC BY-SA 4.0
2024-11-06T16:54:27.583Z
I have updated my answer, hopefully you find something there that helps you.
RedGrittyBrick
CC BY-SA 4.0
2024-11-07T14:52:34.180Z
These are the first two entries in debug.log: =206354 version=0x00000001 log2_work=68.965798 tx=8561394 date='2012-11-04T01:33:25Z' progress=0.007771 cache=15.8MiB(126352txo)
2024-10-26T17:44:19Z UpdateTip: new best=00000000000001922ffa0ca8429e87844ee626db025992228ee7b0e839101b20 height=206355 version=0x00000001 log2_work=68.965833 tx=8561460 date='2012-11-04T01:27:14Z' progress=0.007771 cache=15.8MiB(126441txo)       I didn't notice anything else in the file that would give me any clues as to what is gone wrong here.
Eoin
CC BY-SA 4.0
2024-11-07T15:24:23.087Z
When I set datadir=<Home/.bitcoin/blocks> in bitcoin.conf file I get the following error: Error: Error reading configuration file: specified data directory "<Home/.bitcoin/blocks>" does not exist.
Eoin
CC BY-SA 4.0
2024-11-08T14:36:22.900Z
`$HOME` (not  `Home`) is an environment-variable whose value is probably something like `/home/eoin` depending on your operating system, distribution, its configuration and your chosen user-ID. AFAIK the `datadir` value should not include the `/blocks` subdirectory, you should point at the one above that. In other words, I'd expect  `datadir=/home/eoin/.bitcoin/` would be the default location if, for example, you use Ubuntu 24 with no customisation and your user-ID is `eoin`.  Also you shouldn't have `<>` around the value. See https://github.com/bitcoin/bitcoin/blob/master/doc/bitcoin-conf.md
RedGrittyBrick
CC BY-SA 4.0
2024-11-08T16:22:58.090Z
I have updated the datadir for your changes above and it seems to accept it ok. Here is a screenshot of what I am seeing from bitcoin core 28.0 : https://ibb.co/Sdf9KGg
Eoin
CC BY-SA 4.0
2024-11-09T16:11:52.163Z
I played around with regtest, signet and testnet. Would this have moved the blockchain somewhere else?
Eoin
CC BY-SA 4.0
2024-11-04T13:13:31.090Z
2024-11-06T17:13:06.840Z
2024-11-06T17:13:06.840Z
RedGrittyBrick
<p>I have just downloaded bitcoin core v28.0 from bitcoincore.org.</p>
<p>However, the new version of bitcoin core is not taking the copy of the blockchain which is on my machine from bitcoin core 27 and 26.</p>
<p>How can I get v28.0 to use the blockchain data which is already on my machine from versions 27 and 26?</p>
<p>I've been playing around with the bitcoin.conf datadir to no success.</p>
<hr />
<p>The GUI status bar says: <code>Number of Blocks left: Unknown. Synching headers (241603, 28.7%)... Last block time Sat Apr 6 3013 Progress 1.46%</code></p>
<pre><code>$ bitcoin-cli getblockchaininfo 
{
 &quot;chain&quot;: &quot;main&quot;, 
 &quot;blocks&quot;: 237023, 
 &quot;headers&quot;: 241603, 
 &quot;bestblockhash&quot;: &quot;000000000000002a9ea9139b011c1643d65fc5dca4af9c87bd09ad3d29c4025c&quot;, 
 &quot;difficulty&quot;: 11187257.46136079, 
 &quot;time&quot;: 1369030450, 
 &quot;mediantime&quot;: 1369026380, 
 &quot;verificationprogress&quot;: 0.0165687083236199, 
 &quot;initialblockdownload&quot;: true,
 &quot;chainwork&quot;: &quot;0000000000000000000000000000000000000000000000439abfc36db3cce000&quot;, 
 &quot;size_on_disk&quot;: 10021451300, 
 &quot;pruned&quot;: false, 
 &quot;warnings&quot;: &quot;&quot; 
} 
</code></pre>

CC BY-SA 4.0
2024-10-26T20:49:28.783Z
What operating system are you using?
Ava Chow
CC BY-SA 4.0
2024-10-27T12:31:06.563Z
I am using the Ubuntu OS v22.04
Eoin
CC BY-SA 4.0
2024-11-01T18:06:42.743Z
Hello anyone know
Eoin
CC BY-SA 4.0
2024-11-04T11:52:55.817Z
You should not need to do anything. Just installing the new version should make it use the block and validation data you already have. If it doesn't, that is a bug, but we will need a lot more information about what is going on to figure out what is wrong. Where did you install Bitcoin Core? What appears in debug.log? What happens if you run the old version again?
Pieter Wuille
CC BY-SA 4.0
2024-11-05T14:19:37.090Z
Bitcoin Core is in the home directory. debug.log is a huge file with the date and time of each block since 2012.
Eoin
CC BY-SA 4.0
2024-11-05T14:20:06.757Z
If I run the old version it too starts to download the blockchain from block 0.
Eoin
<datadir><blocks.dat>
New download of bitcoin core v28.0, how to use blocks which have already been downloaded to my machine?
Eoin
# New download of bitcoin core v28.0, how to use blocks which have already been downloaded to my machine?

(Asked by: username_0 on 2024-10-26)

I have just downloaded bitcoin core v28.0 from bitcoincore.org.

However, the new version of bitcoin core is not taking the copy of the blockchain which is on my machine from bitcoin core 27 and 26.

How can I get v28.0 to use the blockchain data which is already on my machine from versions 27 and 26?

I've been playing around with the bitcoin.conf datadir to no success.

---

The GUI status bar says: `Number of Blocks left: Unknown. Synching headers (241603, 28.7%)... Last block time Sat Apr 6 3013 Progress 1.46%`

```
$ bitcoin-cli getblockchaininfo 
{
 "chain": "main", 
 "blocks": 237023, 
 "headers": 241603, 
 "bestblockhash": "000000000000002a9ea9139b011c1643d65fc5dca4af9c87bd09ad3d29c4025c", 
 "difficulty": 11187257.46136079, 
 "time": 1369030450, 
 "mediantime": 1369026380, 
 "verificationprogress": 0.0165687083236199, 
 "initialblockdownload": true,
 "chainwork": "0000000000000000000000000000000000000000000000439abfc36db3cce000", 
 "size_on_disk": 10021451300, 
 "pruned": false, 
 "warnings": "" 
} 

```

**Tags:** datadir, blocks.dat

> **Comments:**
> **username_1**: What operating system are you using?  
> **username_0**: I am using the Ubuntu OS v22.04  
> **username_0**: Hello anyone know  
> **username_2**: You should not need to do anything. Just installing the new version should make it use the block and validation data you already have. If it doesn't, that is a bug, but we will need a lot more information about what is going on to figure out what is wrong. Where did you install Bitcoin Core? What appears in debug.log? What happens if you run the old version again?  
> **username_0**: Bitcoin Core is in the home directory. debug.log is a huge file with the date and time of each block since 2012.  
> **username_0**: If I run the old version it too starts to download the blockchain from block 0.  

---

## 1 answers

### Answer by username_3 on 2024-11-04. Score: 0

> **How can I get [the current version] to use the blockchain data which is already on my machine from [prior versions]**

I believe the appropriate process is something like this:

1. Close bitcoin-qt, bitcoind etc. Make backups. Check backups.
2. Locate the Blockchain data.
   E.g `sudo find / -name blk00000.dat`
3. Configure Bitcoin Core to use that location. `vi $HOME/.bitcoin/bitcoin.conf` if directory isn't in default location where bitcoin looks. See [`datadir`](https://bitcoin.stackexchange.com/q/93403/13866) and `walletdir`
4. If needed, [move a copy of important `wallet.dat` to appropriate location](https://bitcoin.stackexchange.com/q/3449/13866). See [existing guidance](https://bitcoin.stackexchange.com/search?q=location+wallet.dat).

---

For comparison, here is the response for `getblockchaininfo` on a Bitcoin node that hasn't been run for 6 months on a PC that has inadequate resources (100% disk usage)

```
{
  "chain": "main",
  "blocks": 849345,
  "headers": 869149,
  "bestblockhash": "0000000000000000000090dd75955aeb49fb6a51f259f3d6ee3c9639ce241ced",
  "difficulty": 83675262295059.91,
  "time": 1719257861,
  "mediantime": 1719254246,
  "verificationprogress": 0.9679465468853898,
  "initialblockdownload": true,
  "chainwork": "0000000000000000000000000000000000000000803db1ef35254b7ce5b55f8a",
  "size_on_disk": 660000239919,
  "pruned": false,
  "warnings": ""
}

```

I think a key thing here is the number of `blocks` the program knows of.

This PC has a `blocks` folder with about 615 GB of data in it and a `chainstate` folder with under 12 GB of data in it.

Your equivalent information does support your conclusion that the program isn't seeing all your data. Maybe it has logged a reason why it isn't using all the data (e.g. some error message concerning a block file?)

In the file `debug.log` I see

```
2024-11-05T18:22:16Z Bitcoin Core version v24.0.1 (release build)
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -> setting -upnp=0
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -> setting -natpmp=0
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -> setting -discover=0
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -> setting -listenonion=0
2024-11-05T18:22:16Z InitParameterInteraction: parameter interaction: -listen=0 -> setting -i2pacceptincoming=0
...
2024-11-05T18:22:25Z Default data directory XXXXXXX/Bitcoin
2024-11-05T18:22:25Z Using data directory XXXXXXX/Bitcoin
2024-11-05T18:22:25Z Config file: XXXXXXX/Bitcoin\bitcoin.conf
...
2024-11-05T18:22:47Z LoadBlockIndexDB: last block file = 4309
2024-11-05T18:22:48Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=84, size=126890608, heights=845620...845702, time=2024-05-29...2024-05-29)
2024-11-05T18:22:48Z Checking all blk files are present...
...

```

Note the last few lines above. You'll have to search for the latest occurrence of these to check that the program is actually looking in the place you instructed.

Your `debug.log` should show you where Bitcoin core thinks your data is located and this should help you work out what is happening.

There may be other error messages earlier in the debug.log that explain why the program needed to do what it is doing.

> **Comments:**
> **username_0**: I ran `sudo find / -name blk00000.dat` and it found the data directory in home/mickin/.bitcoin/blocks/blk00000.dat  
> **username_3**: How many blk*.dat files are in there and what are their creation dates? If that is the only directory containing a blk00000.dat and few other blk0*.dat all dated recently, it means your original block data has perhaps all been deleted or was originally elsewhere (perhaps on a drive since removed/disconnected/unplugged)  
> **username_0**: There are 4216 blk*.dat files in home/.bitcoin/blocks. There are also 4216 rev.dat files in the folder. These files were all last modified since between 31 Mar and 16 May of this year. I did not delete any block data and did not use any other drives.  
> **username_0**: When I scan my HDD it says that i am using 590GB of my HDD storage.  
> **username_3**: What does the GUI status bar say? (e.g. "Synchronising Headers (99.9%), 5 weeks behind") and in Window/Console, the CLI or using RPC API, what is the response to command `getblockchaininfo`?  
> **username_0**: The GUI status bar says: Number of Blocks left: Unknown. Synching headers (241603, 28.7%)...       Last block time Sat Apr 6 3013                 Progress 1.46%  
> **username_0**: mickin@mickin-IdeaPad-3-15IAU7:~$ bitcoin-cli getblockchaininfo {   "chain": "main",   "blocks": 237023,   "headers": 241603,   "bestblockhash": "000000000000002a9ea9139b011c1643d65fc5dca4af9c87bd09ad3d29c4025c",   "difficulty": 11187257.46136079,   "time": 1369030450,   "mediantime": 1369026380,   "verificationprogress": 0.0165687083236199,   "initialblockdownload": true,   "chainwork": "0000000000000000000000000000000000000000000000439abfc36db3cce000",   "size_on_disk": 10021451300,   "pruned": false,   "warnings": "" }  
> **username_3**: I added that info to your question.  
> **username_3**: I have updated my answer, hopefully you find something there that helps you.  
> **username_0**: These are the first two entries in debug.log: =206354 version=0x00000001 log2_work=68.965798 tx=8561394 date='2012-11-04T01:33:25Z' progress=0.007771 cache=15.8MiB(126352txo) 2024-10-26T17:44:19Z UpdateTip: new best=00000000000001922ffa0ca8429e87844ee626db025992228ee7b0e839101b20 height=206355 version=0x00000001 log2_work=68.965833 tx=8561460 date='2012-11-04T01:27:14Z' progress=0.007771 cache=15.8MiB(126441txo)       I didn't notice anything else in the file that would give me any clues as to what is gone wrong here.  
> **username_0**: When I set datadir=<Home/.bitcoin/blocks> in bitcoin.conf file I get the following error: Error: Error reading configuration file: specified data directory "<Home/.bitcoin/blocks>" does not exist.  
> **username_3**: `$HOME` (not  `Home`) is an environment-variable whose value is probably something like `/home/username_0` depending on your operating system, distribution, its configuration and your chosen user-ID. AFAIK the `datadir` value should not include the `/blocks` subdirectory, you should point at the one above that. In other words, I'd expect  `datadir=/home/username_0/.bitcoin/` would be the default location if, for example, you use Ubuntu 24 with no customisation and your user-ID is `username_0`.  Also you shouldn't have `<>` around the value. See https://github.com/bitcoin/bitcoin/blob/master/doc/bitcoin-conf.md  
> **username_0**: I have updated the datadir for your changes above and it seems to accept it ok. Here is a screenshot of what I am seeing from bitcoin core 28.0 : https://ibb.co/Sdf9KGg  
> **username_0**: I played around with regtest, signet and testnet. Would this have moved the blockchain somewhere else?  

---

