Snapshots
Snapshots are backup files that you can use to restore the state of Consul servers. You can perform snapshot operations from the HCP Consul interface, the Consul REST API endpoint, or by running the Consul snapshot agent from the command line.
HCP Consul Interface
Complete the following instructions to create a snapshot:
- If you have not already done so, log into the HashiCorp Cloud Platform and click Consul under the Services sidebar menu.
- Click the link to the cluster in the ID column to open its overview screen.
- Click Snapshots in the sidebar menu. Any previously created snapshots will appear on the Snapshots screen.
- Click Create snapshot and specify a name.
- Click Create snapshot to finish.
When the snapshot finishes, you can use it to restore the state of your Consul cluster servers.
Restore
Complete the following instructions to restore Consul servers from a snapshot:
- Open the Snapshots screen and locate the snapshot you want to restore.
- Choose Restore from the ellispes menu.
- When prompted, verify that you want to roll back to the state captured in the snapshot.
Manage
Complete the following instructions to rename or delete a snapshot:
- Open the Snapshots screen and locate the snapshot you want to restore.
- Choose Rename or Delete from the ellispes menu.
- Specify your changes and verify that you want to proceed when prompted.
API
Refer to the snapshot API endpont topic in the Consul documentation for information about creating, restoring, and managing snapshots. API calls must be initiated from the infrastructure environment where your resources are deployed. Follow the instructions in Clients to deploy clients in your runtime so that you can access the API.
Command Line
You can manually create, restore, and manage snapshots from the command line. You can also start the snapshot agent, which is a long-running daemon that automatically creates snapshots.
Refer to the snapshot agent topic in the Consul documentation for information about creating, restoring, and managing snapshots. Commands must be initiated from the infrastructure environment where your resources are deployed.