Skip to Content
Node & OperationsReindex & Recovery

Reindex and Recovery

Use the least destructive recovery step that matches the symptom. Most node data can be rebuilt, but wallets must be protected before any recovery action. Stop the node, preserve wallet backups, and copy logs before running heavy rebuilds.

This page covers node data recovery. It is not a replacement for regular backups; see Backups.

Before recovery

Before changing files or starting reindex:

  1. Stop tidecoind.
  2. Back up every wallet with backupwallet if the node can still start.
  3. If the node cannot start, preserve the entire wallets/ directory before touching node data.
  4. Copy recent debug.log files for diagnosis.
  5. Record the exact error message and startup flags.
  6. Check disk free space and filesystem health.

Never delete wallets/ to repair chainstate or block indexes.

Recovery ladder

StepCommand or actionRebuildsKeeps local block files?Use when
Restart cleanlyStart normally after clean shutdownNothingYesProcess was wedged but storage is healthy.
Rebuild chainstatetidecoind -reindex-chainstateUTXO setYesChainstate replay or LevelDB issue on an unpruned node.
Full reindextidecoind -reindexChainstate, block index, active optional indexesYesBlock index issue, witness validation warning, or pruned-node recovery path.
Rebuild optional indexesDisable/delete index data or restart with index flagsSelected indexesYestxindex, block filter, or coinstats index is corrupt.
Resync from peersMove/delete block and chainstate data after wallet backupEverythingNoLocal block files are missing or unusable.

-reindex-chainstate is not compatible with prune mode. Use full -reindex for pruned nodes when the node explicitly requires reindex recovery.

Symptom to action

Symptom or log messageFirst action
Unable to replay blocksTry -reindex-chainstate on an unpruned node.
Unsupported chainstate database formatUse -reindex-chainstate unless the node asks for full reindex.
Witness data after a height requires validationUse -reindex.
Pruned node needs data beyond pruned rangeUse -reindex; expect redownload if needed.
Prune mode incompatible with -reindex-chainstateUse -reindex.
Block index corruptionUse -reindex.
Optional index corruptionRebuild the affected index.
Disk fullFree disk first, then restart or reindex only if errors remain.
Repeated wallet database errorsStop and protect wallet backups before doing anything else.

If the node gives a specific startup error, follow that error before applying a generic recovery ladder.

What each flag does

FlagBehavior
-reindex-chainstateWipes chainstate and rebuilds the UTXO set from existing block files.
-reindexWipes chainstate and block index, rebuilds them from local blk*.dat files, and rebuilds active optional indexes.
-loadblock=<file>Imports blocks from an external block file on startup.

Reindexing does not require deleting wallets. Wallet rescans may happen after node state becomes available, depending on wallet state and available indexes.

Time and disk expectations

Recovery actionTime costDisk cost
RestartMinutesNo extra chain data.
-reindex-chainstateDepends on local block history and disk speedNeeds existing block files and temporary database writes.
-reindexLonger than chainstate rebuildRebuilds block index and active indexes.
Resync from peersLongestRedownloads block data and rebuilds all local state.

Do not start recovery with a nearly full disk. Rebuilds write new database state and logs, and failures during recovery are harder to diagnose.

Pruned nodes

Pruned nodes intentionally delete old block files. This limits recovery options:

CaseConsequence
txindex=1 neededPruning is incompatible with txindex.
-reindex-chainstate requestedPrune mode rejects it; use -reindex.
Wallet needs blocks older than prune horizonThe node may need full reindex or redownload.
Explorer/indexer workloadUse an unpruned node instead.

If operational recovery speed matters, do not use pruning for exchange, explorer, pool, or indexer nodes.

Safe file handling

When preserving data before recovery, copy or snapshot:

ItemWhy
wallets/Protects wallet databases if RPC backup is unavailable.
Wallet backups from backupwalletPreferred recovery artifact.
tidecoin.confPreserves node role and RPC/network settings.
debug.logPreserves the original failure evidence.
blocks/Can avoid redownloading blocks if usable.

Move questionable node-state directories aside instead of deleting them immediately. For example, with the node stopped, rename chainstate/ to a dated quarantine directory before attempting a rebuild when manual intervention is needed.

Source of truth

TopicSource
Reindex flags../tidecoin/src/init.cpp
Chainstate recovery errors../tidecoin/src/node/chainstate.cpp, ../tidecoin/src/txdb.cpp
Data layout../tidecoin/doc/files.md
Wallet backup safety../tidecoin/doc/managing-wallets.md

See also: Backups, Troubleshooting, Data Directory.

Last updated on