mirror of https://github.com/status-im/consul.git
51 lines
1.4 KiB
Plaintext
51 lines
1.4 KiB
Plaintext
---
|
|
layout: commands
|
|
page_title: 'Commands: Snapshot Restore'
|
|
---
|
|
|
|
# Consul Snapshot Restore
|
|
|
|
Command: `consul snapshot restore`
|
|
|
|
Corresponding HTTP API Endpoint: [\[PUT\] /v1/snapshot](/api-docs/snapshot#restore-snapshot)
|
|
|
|
The `snapshot restore` command is used to restore an atomic, point-in-time
|
|
snapshot of the state of the Consul servers which includes key/value entries,
|
|
service catalog, prepared queries, sessions, and ACLs. The snapshot is read
|
|
from the given file.
|
|
|
|
Restores involve a potentially dangerous low-level Raft operation that is not
|
|
designed to handle server failures during a restore. This command is primarily
|
|
intended to be used when recovering from a disaster, restoring into a fresh
|
|
cluster of Consul servers.
|
|
|
|
The table below shows this command's [required ACLs](/api#authentication). Configuration of
|
|
[blocking queries](/api/features/blocking) and [agent caching](/api/features/caching)
|
|
are not supported from commands, but may be from the corresponding HTTP endpoint.
|
|
|
|
| ACL Required |
|
|
| ------------ |
|
|
| `management` |
|
|
|
|
## Usage
|
|
|
|
Usage: `consul snapshot restore [options] FILE`
|
|
|
|
#### API Options
|
|
|
|
@include 'http_api_options_client.mdx'
|
|
|
|
@include 'http_api_options_server.mdx'
|
|
|
|
## Examples
|
|
|
|
To restore a snapshot from the file "backup.snap":
|
|
|
|
```shell-session
|
|
$ consul snapshot restore backup.snap
|
|
Restored snapshot
|
|
```
|
|
|
|
Please see the [HTTP API](/api/snapshot) documentation for
|
|
more details about snapshot internals.
|