You are reading the Teku development version documentation and some features may not be available in the stable release. You can switch to the stable version using the version box at the bottom of the screen.

Updated on May 19, 2021

# Migrate the database

As of v21.5.0, new Teku installations use a LevelDB2 database. Previous Teku versions use RocksDB which continue to be supported.

LevelDB2 databases use less memory and are proven to be more stable with Teku. Users can migrate Teku nodes running a RocksDB database to a LevelDB2 database if the Teku node runs in pruning mode.

Warning

Teku nodes running in archive mode have to resync from genesis to migrate. Tools to migrate existing databases will be provided in future releases.

To migrate a RocksDB database in pruning mode to a LevelDB2 database:

curl -o state.ssz -H 'Accept: application/octet-stream' http://other-node:5051/eth/v1/debug/beacon/states/finalized


Note

This step is optional, you can also supply the finalized checkpoint state via URL from a beacon chain node or Infura when restarting Teku in the step below.

2. Stop the Teku node you intend to migrate.

3. Delete the beacon directory in your data path.

Warning

Ensure not to delete the validator directory if one is present as this contains your slashing protection data.

4. Restart Teku and specify the downloaded finalized state using the --initial-state command.

Teku creates a LevelDB2 database, and starts from the specified recent state. Teku should be in sync and validating within minutes.

Questions or feedback? You can discuss issues and obtain free support on Teku Discord channel.