<commit_before><!-- # How to restore a portable snapshot with full state history -->

## Goal

This procedure restores an existing snapshot with full history, so the node can become active in the blockchain.

## Before you begin

* Make sure [EOSIO is installed](../../../00_install/index.md).
* Learn about [Using Nodeos](../../02_usage/index.md).
* Get familiar with [state_history](../../03_plugins/state_history_plugin/index.md) plugin.

## Steps

1. Get the following:
   * A portable snapshot (`data/snapshots/snapshot-xxxxxxx.bin`)
   * The contents of `data/state-history`
   * Optional: a block log which includes the block the snapshot was taken at. Do not include `data/blocks/reversible`.

2. Make sure `data/state` does not exist

3. Start `nodeos` with the `--snapshot` option, and the options listed in the [`state_history_plugin`](#index.md).

4. Do not stop `nodeos` until it has received at least 1 block from the network, or it won't be able to restart.

## Remarks

If `nodeos` fails to receive blocks from the network, then try the above using `net_api_plugin`. Use `cleos net disconnect` and `cleos net connect` to reconnect nodes which timed out.

[[caution | Caution when using `net_api_plugin`]]<commit_msg>state_history -> state_history_plugin<commit_after><!-- # How to restore a portable snapshot with full state history -->

## Goal

This procedure restores an existing snapshot with full history, so the node can become active in the blockchain.

## Before you begin

* Make sure [EOSIO is installed](../../../00_install/index.md).
* Learn about [Using Nodeos](../../02_usage/index.md).
* Get familiar with [state_history_plugin](../../03_plugins/state_history_plugin/index.md) .

## Steps

1. Get the following:
   * A portable snapshot (`data/snapshots/snapshot-xxxxxxx.bin`)
   * The contents of `data/state-history`
   * Optional: a block log which includes the block the snapshot was taken at. Do not include `data/blocks/reversible`.

2. Make sure `data/state` does not exist

3. Start `nodeos` with the `--snapshot` option, and the options listed in the [`state_history_plugin`](#index.md).

4. Do not stop `nodeos` until it has received at least 1 block from the network, or it won't be able to restart.

## Remarks

If `nodeos` fails to receive blocks from the network, then try the above using `net_api_plugin`. Use `cleos net disconnect` and `cleos net connect` to reconnect nodes which timed out.

[[caution | Caution when using `net_api_plugin`]]
{'fraction_non_alphanumeric': 0.11008437123342708, 'fraction_numerical': 0.008838891120932101, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7594566', 'n_tokens_mistral': 736, 'n_tokens_neox': 709, 'n_words': 311}