2016-10-26 02:20:24 +00:00
|
|
|
---
|
|
|
|
layout: "docs"
|
|
|
|
page_title: "Commands: Snapshot Restore"
|
|
|
|
sidebar_current: "docs-commands-snapshot-restore"
|
|
|
|
---
|
|
|
|
|
|
|
|
# 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
|
|
|
|
snapshot a snapshot save.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Usage: `consul snapshot restore [options] FILE`
|
|
|
|
|
|
|
|
#### API Options
|
|
|
|
|
2017-02-08 00:16:33 +00:00
|
|
|
<%= partial "docs/commands/http_api_options_client" %>
|
2017-02-10 01:00:38 +00:00
|
|
|
<%= partial "docs/commands/http_api_options_server" %>
|
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.
|