fe2f650240
* ACL * ACL * Catalog * consul config * consul connect * top-level updates * consul intention * consul kv * consul namespace * consul peering * consul peering delete * consul services * consul snapshot * consul tls * consul acl auth-method * acl binding-rule * acl policy * acl role * acl token * fix * standardization * Update website/content/commands/snapshot/save.mdx Co-authored-by: Bryce Kalow <bkalow@hashicorp.com> * consul debug consul keyring Co-authored-by: Bryce Kalow <bkalow@hashicorp.com> Co-authored-by: Tu Nguyen <im2nguyen@users.noreply.github.com>
54 lines
1.8 KiB
Plaintext
54 lines
1.8 KiB
Plaintext
---
|
|
layout: commands
|
|
page_title: 'Commands: Snapshot Restore'
|
|
description: |
|
|
The `consul snapshot restore` command restores the state of Consul servers after a disaster. A server can restore key/value entries, registered services in the catalog, prepared queries, sessions, and ACLs from a saved snapshot.
|
|
---
|
|
|
|
# Consul Snapshot Restore
|
|
|
|
Command: `consul snapshot restore`
|
|
|
|
Corresponding HTTP API Endpoint: [\[PUT\] /v1/snapshot](/consul/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 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.
|
|
|
|
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)
|
|
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](/consul/api-docs/snapshot) documentation for
|
|
more details about snapshot internals.
|