Skip to content

Backup And Restore

Platonx99 edited this page May 29, 2018 · 7 revisions

DO NOT FORGET YOUR PASSWORD and BACKUP YOUR KEYSTORE

Backup & restore

Data directory

Everything webchaind persists gets written inside its data directory The default data directory locations are platform specific:

  • Linux: `~/.webchain
  • Windows: %APPDATA%\Webchain

Accounts are stored in the keystore subdirectory

To configure the location of the data directory, the --datadir parameter can be specified. See CLI Options for more details.

Upgrades

Sometimes the internal database formats need updating . This can be run with the following command (webchaind should not be otherwise running):

webchaind upgradedb

Cleanup

Webchaind blockchain and state databases can be removed with:

webchaind removedb

This is useful for deleting an old chain and sync'ing to a new one. It only affects data directories that can be re-created on synchronisation and does not touch the keystore.

Blockchain import/export

Export the blockchain in binary format with:

webchaind export <filename>

Or if you want to back up portions of the chain over time, a first and last block can be specified. For example, to back up the first epoch:

webchaind export <filename> 0 29999

Note that when backing up a partial chain, the file will be appended rather than truncated.

Import binary-format blockchain exports with:

webchaind import <filename>

See Blockchain Import Export for more info

And finally: DO NOT FORGET YOUR PASSWORD and BACKUP YOUR KEYSTORE

Clone this wiki locally