mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
improve backup/restore docs
This commit is contained in:
parent
331f0da16b
commit
f8c0622426
1 changed files with 22 additions and 30 deletions
|
|
@ -1,41 +1,28 @@
|
||||||
---
|
---
|
||||||
title: Backup & restore
|
title: Backup & Restore
|
||||||
sort_key: C
|
sort_key: C
|
||||||
---
|
---
|
||||||
|
|
||||||
**DO NOT FORGET YOUR PASSWORD** and **BACKUP YOUR KEYSTORE**
|
Most important info first: **REMEMBER YOUR PASSWORD** and **BACKUP YOUR KEYSTORE**.
|
||||||
|
|
||||||
<!--
|
## Data Directory
|
||||||
This whole page can be nuked, _except_ for the info about
|
|
||||||
where the keystore is located and advise the user
|
|
||||||
to back up his keystore. That section should be moved
|
|
||||||
into both accounts-info but also to any getting-started guide.
|
|
||||||
-->
|
|
||||||
|
|
||||||
# Backup & restore
|
Everything `geth` persists gets written inside its data directory. The default data
|
||||||
|
directory locations are platform specific:
|
||||||
## Data directory
|
|
||||||
|
|
||||||
Everything `geth` persists gets written inside its data directory (except for the PoW Ethash DAG, see note below).
|
|
||||||
The default data directory locations are platform specific:
|
|
||||||
|
|
||||||
* Mac: `~/Library/Ethereum`
|
* Mac: `~/Library/Ethereum`
|
||||||
* Linux: `~/.ethereum`
|
* Linux: `~/.ethereum`
|
||||||
* Windows: `%APPDATA%\Ethereum`
|
* Windows: `%APPDATA%\Ethereum`
|
||||||
|
|
||||||
Accounts are stored in the `keystore` subdirectory. The contents of this directories should be transportable between nodes, platforms, implementations (C++, Go, Python).
|
Accounts are stored in the `keystore` subdirectory. The contents of this directories
|
||||||
|
should be transportable between nodes, platforms, implementations (C++, Go, Python).
|
||||||
|
|
||||||
To configure the location of the data directory, the `--datadir` parameter can be specified. See [CLI Options](../interface/command-line-options) for more details.
|
To configure the location of the data directory, the `--datadir` parameter can be
|
||||||
|
specified. See [CLI Options](../interface/command-line-options) for more details.
|
||||||
|
|
||||||
_**note:** the [ethash dag](../legacy/mining) is stored at `~/.ethash` (Mac/Linux) or `%APPDATA%\Ethash` (Windows) so that it can be reused by all clients. You can store this in a different location by using a symbolic link._
|
Note the [ethash dag](../interface/mining) is stored at `~/.ethash` (Mac/Linux) or
|
||||||
|
`%APPDATA%\Ethash` (Windows) so that it can be reused by all clients. You can store this
|
||||||
## Upgrades
|
in a different location by using a symbolic link.
|
||||||
|
|
||||||
Sometimes the internal database formats need updating (for example, when upgrade from before 0.9.20). This can be run with the following command (geth should not be otherwise running):
|
|
||||||
|
|
||||||
```
|
|
||||||
geth upgradedb
|
|
||||||
```
|
|
||||||
|
|
||||||
## Cleanup
|
## Cleanup
|
||||||
|
|
||||||
|
|
@ -45,24 +32,29 @@ Geth's blockchain and state databases can be removed with:
|
||||||
geth removedb
|
geth 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.
|
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
|
## Blockchain Import/Export
|
||||||
|
|
||||||
Export the blockchain in binary format with:
|
Export the blockchain in binary format with:
|
||||||
|
|
||||||
```
|
```
|
||||||
geth export <filename>
|
geth 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:
|
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:
|
||||||
|
|
||||||
```
|
```
|
||||||
geth export <filename> 0 29999
|
geth export <filename> 0 29999
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that when backing up a partial chain, the file will be appended rather than truncated.
|
Note that when backing up a partial chain, the file will be appended rather than
|
||||||
|
truncated.
|
||||||
|
|
||||||
Import binary-format blockchain exports with:
|
Import binary-format blockchain exports with:
|
||||||
|
|
||||||
```
|
```
|
||||||
geth import <filename>
|
geth import <filename>
|
||||||
```
|
```
|
||||||
|
|
@ -70,4 +62,4 @@ geth import <filename>
|
||||||
_See https://github.com/ethereum/wiki/wiki/Blockchain-import-export for more info_
|
_See https://github.com/ethereum/wiki/wiki/Blockchain-import-export for more info_
|
||||||
|
|
||||||
|
|
||||||
And finally: **DO NOT FORGET YOUR PASSWORD** and **BACKUP YOUR KEYSTORE**
|
And finally: **REMEMBER YOUR PASSWORD** and **BACKUP YOUR KEYSTORE**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue