<p>The message says</p>
<blockquote>
<p>2018-11-16T09:16:48Z LoadBlockIndexDB(): Block files have previously been pruned</p>
<p>2018-11-16T09:16:48Z : You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain.</p>
<p>Please restart with -reindex or -reindex-chainstate to recover.</p>
</blockquote>
<p>If you have been running in pruned mode, bitcoind has been pruning the blockchain. This means it has discarded data to save disk space.</p>
<p>To run in non-pruned mode you must recover the missing data. The method provided is to download the entire blockchain again.</p>
<p>The only obvious alternative is, presumably, to run in pruned mode.</p>
<hr />
<p>Related questions:</p>
<ul>
<li><a href="https://bitcoin.stackexchange.com/q/37496/13866">How can I run bitcoind in pruning mode?</a></li>
</ul>
<p>Related links:</p>
<ul>
<li><p><a href="https://bitcointalk.org/index.php?topic=1599458.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=1599458.0</a> (August 2016)</p>
<blockquote>
<blockquote>
<p>OK, I have a question. Say: I enabled prune mode and Bitcoin Core effectively started working in this mode. But it is one way ticket if I ever want to go back to 'full' mode I need to download and verify whole blockchain once again there is no shortcuts?</p>
</blockquote>
<p>Yes, you will have to redownload the entire blockchain, there are no shortcuts</p>
</blockquote>
</li>
</ul>

CC BY-SA 4.0
2018-11-16T11:03:17.180Z
2018-11-16T11:11:24.727Z
2020-06-16T11:10:03.350Z
RedGrittyBrick
<p>I installed bitcoin, following <a href="https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch03.asciidoc" rel="nofollow noreferrer">this</a> instructions.</p>

<p>I mostly used it with <code>bitcoin-qt -testnet</code> options, even made a few transactions in testnet. I am using the pruned mode.</p>

<p>Now I want to run the <code>bitcoind</code> and then connect <code>bitcoin-cli</code> to it.</p>

<p>But when I run the following command: <code>bitcoind -testnet</code>, I get the following output:</p>

<pre><code>punnysher@punnysher ~ $ bitcoind -testnet

2018-11-16T09:16:40Z Bitcoin Core version v0.17.0.1 (release build)

2018-11-16T09:16:40Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -&gt; setting -whitelistrelay=1

2018-11-16T09:16:40Z Assuming ancestors of block 0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75 have valid signatures.

2018-11-16T09:16:40Z Setting nMinimumChainWork=00000000000000000000000000000000000000000000007dbe94253893cbd463

2018-11-16T09:16:40Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation

2018-11-16T09:16:40Z Using RdRand as an additional entropy source

2018-11-16T09:16:40Z Default data directory /home/punnysher/.bitcoin

2018-11-16T09:16:40Z Using data directory /home/punnysher/.bitcoin/testnet3

2018-11-16T09:16:40Z Using config file /home/punnysher/.bitcoin/bitcoin.conf

2018-11-16T09:16:40Z Using at most 125 automatic connections (1024 file descriptors available)

2018-11-16T09:16:40Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements

2018-11-16T09:16:40Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements

2018-11-16T09:16:40Z Using 4 threads for script verification

2018-11-16T09:16:40Z scheduler thread start

2018-11-16T09:16:40Z HTTP: creating work queue of depth 16

2018-11-16T09:16:40Z No rpcpassword set - using random cookie authentication.

2018-11-16T09:16:40Z Generated RPC authentication cookie /home/punnysher/.bitcoin/testnet3/.cookie

2018-11-16T09:16:40Z HTTP: starting 4 worker threads

2018-11-16T09:16:40Z Using wallet directory /home/punnysher/.bitcoin/testnet3/wallets

2018-11-16T09:16:40Z init message: Verifying wallet(s)...

2018-11-16T09:16:40Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)

2018-11-16T09:16:40Z Using wallet wallet.dat

2018-11-16T09:16:40Z BerkeleyEnvironment::Open: LogDir=/home/punnysher/.bitcoin/testnet3/wallets/database ErrorFile=/home/punnysher/.bitcoin/testnet3/wallets/db.log

2018-11-16T09:16:40Z Cache configuration:

2018-11-16T09:16:40Z * Using 2.0MiB for block index database

2018-11-16T09:16:40Z * Using 8.0MiB for chain state database

2018-11-16T09:16:40Z * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)

2018-11-16T09:16:40Z init message: Loading block index...

2018-11-16T09:16:40Z Opening LevelDB in /home/punnysher/.bitcoin/testnet3/blocks/index

2018-11-16T09:16:40Z Opened LevelDB successfully

2018-11-16T09:16:40Z Using obfuscation key for /home/punnysher/.bitcoin/testnet3/blocks/index: 0000000000000000

2018-11-16T09:16:48Z LoadBlockIndexDB: last block file = 154

2018-11-16T09:16:48Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=2233, size=44632870, heights=1441380...1443684, time=2018-10-31...2018-11-16)

2018-11-16T09:16:48Z Checking all blk files are present...

2018-11-16T09:16:48Z LoadBlockIndexDB(): Block files have previously been pruned

2018-11-16T09:16:48Z : You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain.

Please restart with -reindex or -reindex-chainstate to recover.

: You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain.

Please restart with -reindex or -reindex-chainstate to recover.

2018-11-16T09:16:48Z Aborted block database rebuild. Exiting.

2018-11-16T09:16:48Z Shutdown: In progress...

2018-11-16T09:16:48Z scheduler thread interrupt

2018-11-16T09:16:48Z Shutdown: done

punnysher@punnysher ~ $ 
</code></pre>

CC BY-SA 4.0
2018-11-16T10:28:13.660Z
What happened when you used the command suggested in line 37 of the error message?
RedGrittyBrick
CC BY-SA 4.0
2018-11-16T10:52:59.650Z
It downloads the entire blockchain again, which I really wanted to avoid hence I asked this question.
Vijay Chavda
<bitcoin-core><bitcoind><bitcoin-cli><pruning>
Cant start bitcoind - "Block files have previously been pruned"
Vijay Chavda
# Cant start bitcoind - "Block files have previously been pruned"

(Asked by: username_0 on 2018-11-16)

I installed bitcoin, following [this](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch03.asciidoc) instructions.

I mostly used it with `bitcoin-qt -testnet` options, even made a few transactions in testnet. I am using the pruned mode.

Now I want to run the `bitcoind` and then connect `bitcoin-cli` to it.

But when I run the following command: `bitcoind -testnet`, I get the following output:

```
punnysher@punnysher ~ $ bitcoind -testnet

2018-11-16T09:16:40Z Bitcoin Core version v0.17.0.1 (release build)

2018-11-16T09:16:40Z InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1

2018-11-16T09:16:40Z Assuming ancestors of block 0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75 have valid signatures.

2018-11-16T09:16:40Z Setting nMinimumChainWork=00000000000000000000000000000000000000000000007dbe94253893cbd463

2018-11-16T09:16:40Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation

2018-11-16T09:16:40Z Using RdRand as an additional entropy source

2018-11-16T09:16:40Z Default data directory /home/punnysher/.bitcoin

2018-11-16T09:16:40Z Using data directory /home/punnysher/.bitcoin/testnet3

2018-11-16T09:16:40Z Using config file /home/punnysher/.bitcoin/bitcoin.conf

2018-11-16T09:16:40Z Using at most 125 automatic connections (1024 file descriptors available)

2018-11-16T09:16:40Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements

2018-11-16T09:16:40Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements

2018-11-16T09:16:40Z Using 4 threads for script verification

2018-11-16T09:16:40Z scheduler thread start

2018-11-16T09:16:40Z HTTP: creating work queue of depth 16

2018-11-16T09:16:40Z No rpcpassword set - using random cookie authentication.

2018-11-16T09:16:40Z Generated RPC authentication cookie /home/punnysher/.bitcoin/testnet3/.cookie

2018-11-16T09:16:40Z HTTP: starting 4 worker threads

2018-11-16T09:16:40Z Using wallet directory /home/punnysher/.bitcoin/testnet3/wallets

2018-11-16T09:16:40Z init message: Verifying wallet(s)...

2018-11-16T09:16:40Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)

2018-11-16T09:16:40Z Using wallet wallet.dat

2018-11-16T09:16:40Z BerkeleyEnvironment::Open: LogDir=/home/punnysher/.bitcoin/testnet3/wallets/database ErrorFile=/home/punnysher/.bitcoin/testnet3/wallets/db.log

2018-11-16T09:16:40Z Cache configuration:

2018-11-16T09:16:40Z * Using 2.0MiB for block index database

2018-11-16T09:16:40Z * Using 8.0MiB for chain state database

2018-11-16T09:16:40Z * Using 440.0MiB for in-memory UTXO set (plus up to 286.1MiB of unused mempool space)

2018-11-16T09:16:40Z init message: Loading block index...

2018-11-16T09:16:40Z Opening LevelDB in /home/punnysher/.bitcoin/testnet3/blocks/index

2018-11-16T09:16:40Z Opened LevelDB successfully

2018-11-16T09:16:40Z Using obfuscation key for /home/punnysher/.bitcoin/testnet3/blocks/index: 0000000000000000

2018-11-16T09:16:48Z LoadBlockIndexDB: last block file = 154

2018-11-16T09:16:48Z LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=2233, size=44632870, heights=1441380...1443684, time=2018-10-31...2018-11-16)

2018-11-16T09:16:48Z Checking all blk files are present...

2018-11-16T09:16:48Z LoadBlockIndexDB(): Block files have previously been pruned

2018-11-16T09:16:48Z : You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain.

Please restart with -reindex or -reindex-chainstate to recover.

: You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain.

Please restart with -reindex or -reindex-chainstate to recover.

2018-11-16T09:16:48Z Aborted block database rebuild. Exiting.

2018-11-16T09:16:48Z Shutdown: In progress...

2018-11-16T09:16:48Z scheduler thread interrupt

2018-11-16T09:16:48Z Shutdown: done

punnysher@punnysher ~ $ 

```

**Tags:** bitcoin-core, bitcoind, bitcoin-cli, pruning

> **Comments:**
> **username_1**: What happened when you used the command suggested in line 37 of the error message?  
> **username_0**: It downloads the entire blockchain again, which I really wanted to avoid hence I asked this question.  

---

## 1 answers

### Answer by username_1 on 2018-11-16. Score: 2 | Accepted answer

The message says

> 2018-11-16T09:16:48Z LoadBlockIndexDB(): Block files have previously been pruned
>
> 2018-11-16T09:16:48Z : You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain.
>
> Please restart with -reindex or -reindex-chainstate to recover.

If you have been running in pruned mode, bitcoind has been pruning the blockchain. This means it has discarded data to save disk space.

To run in non-pruned mode you must recover the missing data. The method provided is to download the entire blockchain again.

The only obvious alternative is, presumably, to run in pruned mode.

---

Related questions:

* [How can I run bitcoind in pruning mode?](https://bitcoin.stackexchange.com/q/37496/13866)

Related links:

* <https://bitcointalk.org/index.php?topic=1599458.0> (August 2016)

  > > OK, I have a question. Say: I enabled prune mode and Bitcoin Core effectively started working in this mode. But it is one way ticket if I ever want to go back to 'full' mode I need to download and verify whole blockchain once again there is no shortcuts?
  >
  > Yes, you will have to redownload the entire blockchain, there are no shortcuts


---

