2016-10-26 02:20:24 +00:00
|
|
|
---
|
2020-09-01 15:14:13 +00:00
|
|
|
layout: commands
|
2020-04-07 18:55:19 +00:00
|
|
|
page_title: 'Commands: Snapshot Restore'
|
2016-10-26 02:20:24 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul Snapshot Restore
|
|
|
|
|
|
|
|
Command: `consul snapshot restore`
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
Corresponding HTTP API Endpoint: [\[PUT\] /v1/snapshot](/consul/api-docs/snapshot#restore-snapshot)
|
2022-01-10 17:40:11 +00:00
|
|
|
|
2016-10-26 02:20:24 +00:00
|
|
|
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
|
2022-05-11 04:40:39 +00:00
|
|
|
intended to recover from a disaster. It restores your configuration into a fresh
|
|
|
|
cluster of Consul servers as long as your new cluster runs the same Consul
|
|
|
|
version as the cluster that originally took the snapshot.
|
2016-10-26 02:20:24 +00:00
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The table below shows this command's [required ACLs](/consul/api-docs/api-structure#authentication). Configuration of
|
|
|
|
[blocking queries](/consul/api-docs/features/blocking) and [agent caching](/consul/api-docs/features/caching)
|
2022-01-10 21:44:56 +00:00
|
|
|
are not supported from commands, but may be from the corresponding HTTP endpoint.
|
|
|
|
|
|
|
|
| ACL Required |
|
|
|
|
| ------------ |
|
|
|
|
| `management` |
|
2016-10-26 02:20:24 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Usage: `consul snapshot restore [options] FILE`
|
|
|
|
|
|
|
|
#### API Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_options_client.mdx'
|
2020-04-07 23:56:08 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_options_server.mdx'
|
2016-10-26 02:20:24 +00:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
To restore a snapshot from the file "backup.snap":
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2016-10-26 02:20:24 +00:00
|
|
|
$ consul snapshot restore backup.snap
|
|
|
|
Restored snapshot
|
|
|
|
```
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
Please see the [HTTP API](/consul/api-docs/snapshot) documentation for
|
2016-10-26 02:20:24 +00:00
|
|
|
more details about snapshot internals.
|