<p>I was reading that some people were able to migrate their old index directories to a new machine and not needing to reindex.</p>
<p>But for me it acts as if the chainstate directory is &quot;corrupt&quot;, even though those files were working just fine on the old node. I suspect that it's not really corrupt, but that bitcoin core isn't reading it correctly.
The exact message I see in the logs:</p>
<pre><code>Using obfuscation key for /data/.bitcoin/chainstate
</code></pre>
<p>and then it would reload bitcoind and show this message again, in a loop, and never actually complete starting bitcoind.</p>
<p>What makes this migration process not work for some people, like myself?
I copied the following 4 dirs from the source node to the target node, exactly as they were with no extra or missing files.</p>
<pre><code>bitcoin/blocks/
bitcoin/blocks/index/
bitcoin/chainstate/
bitcoin/indexes/
</code></pre>
<p>And using reindex-chainstate=1 in the config file takes a long time (already been 3 days and it's still not halfway done).</p>
<p>There's probably something that needs to be set for the chainstate directory to be compatible on the new node with bitcoind.</p>

CC BY-SA 4.0
2024-06-18T11:32:33.273Z
From which version to which version are you upgrading? Bitcoin Core should support upgrading from any maintained version without reindex.
Pieter Wuille
CC BY-SA 4.0
2024-06-18T11:55:53.473Z
27.0 on both machines
Pineapple29
CC BY-SA 4.0
2024-06-18T20:10:27.387Z
Can you elaborate on how you get this "corrupt" message? What is the exact error you get? Is there anything in the debug.log file?
Pieter Wuille
CC BY-SA 4.0
2024-06-18T20:14:44.640Z
Did you copy them while your Bitcoin Core was running?
Murch
CC BY-SA 4.0
2024-06-18T21:18:36.627Z
Bitcoin service was stopped on both machines before copying. And to be exact the last line was "Using obfuscation key for /data/.bitcoin/chainstate" and then it would restart bitcoind and show this message again, in a loop
Pineapple29
CC BY-SA 4.0
2024-06-18T22:02:05.783Z
What exactly is the "corrupted" error message?
Pieter Wuille
CC BY-SA 4.0
2024-06-18T22:20:25.633Z
It doesn't say "corrupted" I just figured it is because of how bitcoind start process behaved. I edited my question accordingly. What could be causing it to fail to start, right after checking the chainstate dir? Maybe some missing config I could add?
Pineapple29
CC BY-SA 4.0
2024-06-18T22:28:44.470Z
Bitcoin Core doesn't restart itself; something must be restarting it. Is there some system service running? Perhaps that has logs? Is it possible to run it manually, outside of this service, perhaps with `-nodaemon -printtoconsole=1` on the command line, so you see fatal errors.
Pieter Wuille
<bitcoin-core><bitcoind><reindex>
Why does bitcoin core has to reindex the chainstate directory in some cases?
Pineapple29
# Why does bitcoin core has to reindex the chainstate directory in some cases?

(Asked by: username_0 on 2024-06-18)

I was reading that some people were able to migrate their old index directories to a new machine and not needing to reindex.

But for me it acts as if the chainstate directory is "corrupt", even though those files were working just fine on the old node. I suspect that it's not really corrupt, but that bitcoin core isn't reading it correctly.
The exact message I see in the logs:

```
Using obfuscation key for /data/.bitcoin/chainstate

```

and then it would reload bitcoind and show this message again, in a loop, and never actually complete starting bitcoind.

What makes this migration process not work for some people, like myself?
I copied the following 4 dirs from the source node to the target node, exactly as they were with no extra or missing files.

```
bitcoin/blocks/
bitcoin/blocks/index/
bitcoin/chainstate/
bitcoin/indexes/

```

And using reindex-chainstate=1 in the config file takes a long time (already been 3 days and it's still not halfway done).

There's probably something that needs to be set for the chainstate directory to be compatible on the new node with bitcoind.

**Tags:** bitcoin-core, bitcoind, reindex

> **Comments:**
> **username_1**: From which version to which version are you upgrading? Bitcoin Core should support upgrading from any maintained version without reindex.  
> **username_0**: 27.0 on both machines  
> **username_1**: Can you elaborate on how you get this "corrupt" message? What is the exact error you get? Is there anything in the debug.log file?  
> **username_2**: Did you copy them while your Bitcoin Core was running?  
> **username_0**: Bitcoin service was stopped on both machines before copying. And to be exact the last line was "Using obfuscation key for /data/.bitcoin/chainstate" and then it would restart bitcoind and show this message again, in a loop  
> **username_1**: What exactly is the "corrupted" error message?  
> **username_0**: It doesn't say "corrupted" I just figured it is because of how bitcoind start process behaved. I edited my question accordingly. What could be causing it to fail to start, right after checking the chainstate dir? Maybe some missing config I could add?  
> **username_1**: Bitcoin Core doesn't restart itself; something must be restarting it. Is there some system service running? Perhaps that has logs? Is it possible to run it manually, outside of this service, perhaps with `-nodaemon -printtoconsole=1` on the command line, so you see fatal errors.  

---

## 0 answers

