2016-10-26 02:20:24 +00:00
|
|
|
---
|
2020-04-07 18:55:19 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: 'Commands: Snapshot Restore'
|
2020-04-07 23:56:08 +00:00
|
|
|
sidebar_title: 'restore'
|
2020-04-07 18:55:19 +00:00
|
|
|
sidebar_current: docs-commands-snapshot-restore
|
2016-10-26 02:20:24 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# Consul Snapshot Restore
|
|
|
|
|
|
|
|
Command: `consul snapshot restore`
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
If ACLs are enabled, a management token must be supplied in order to perform
|
2019-02-20 16:42:38 +00:00
|
|
|
a snapshot restore.
|
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":
|
|
|
|
|
|
|
|
```text
|
|
|
|
$ consul snapshot restore backup.snap
|
|
|
|
Restored snapshot
|
|
|
|
```
|
|
|
|
|
2017-04-04 16:33:22 +00:00
|
|
|
Please see the [HTTP API](/api/snapshot.html) documentation for
|
2016-10-26 02:20:24 +00:00
|
|
|
more details about snapshot internals.
|