Backing up and restoring OpenBao with Raft snapshots

Raft snapshots are the backup path for OpenBao integrated storage, and a backup you have never restored is a guess. This page covers how to take, automate, protect and rehearse restores of OpenBao snapshots.

On this page

Why OpenBao Raft snapshots need a tested restore path

A snapshot is only useful if you can restore it, and most teams find out whether they can at the worst possible moment. This section explains why a team running OpenBao on integrated storage (Raft) should treat snapshots as a recovery control that needs an owner, a schedule and a rehearsed restore, not as a background file job. Data loss or corruption in the Raft store can leave a cluster unable to serve secrets, leases and policies, and the business impact lands on every application that reads from it.

A Raft snapshot, as the OpenBao storage and HA docs describe the integrated storage backend, captures the state that the Raft cluster holds for OpenBao, including the encrypted data that OpenBao writes to storage. You need one when a cluster loses quorum beyond repair, when an operator or a bad change corrupts or deletes data, or when you must roll a cluster back to a known state. Because the snapshot holds encrypted storage contents, it does not hold everything needed to run the cluster again. The page explains how to take a snapshot with bao operator raft snapshot, where to keep it so it stays protected, how to automate the schedule, and how to rehearse a full restore on separate infrastructure.

A snapshot is one part of recovery, not a substitute for unseal material and key custody. Restoring the data also requires the unseal keys or the auto-unseal mechanism you chose, the recovery keys if your configuration uses them, and the access needed to bring nodes back online. Before you rely on any backup, confirm in writing where your unseal material is held, who can use it, and how it is recovered if the team that set up the cluster has left. Confirm these controls against the OpenBao documentation for your version and against your own change and key custody procedures.

Snapshot options and when each fits

This table compares the ways a team can take Raft snapshots of OpenBao, where they can be stored and how long they are kept. Read each row against your cluster size and the people available to run it, since the operational burden grows as you move from a manual command to an automated pipeline with off-site copies. The main takeaway is that a snapshot is only useful if it is scheduled, encrypted, copied off the cluster and proven restorable.

OptionBest fitWhat the team must operate
On-demand snapshot with bao operator raft snapshot saveSmall or lab clusters, or a one-off capture before an upgrade or migrationSomeone runs the command by hand, names the file, moves it off the node and records when it was taken
Scheduled snapshot from cron or an orchestrator jobMost production clusters with a steady change rate and a defined recovery point targetA scheduler, a token with snapshot rights, failure alerts, and a job that reports success only after the file is verified
Snapshot to object storage with server-side encryptionTeams with an existing S3-compatible or cloud bucket and a retention policy they already enforceBucket policy, access logging, key management for encryption, and lifecycle rules that match the retention you have written down
Snapshot to a backup platformOrganizations that already run enterprise backup and want one catalog, one restore workflow and central reportingConfirm with the backup vendor that the encrypted file is handled correctly, how restore is invoked and who may trigger it
Retention policy by count or ageSmall clusters can keep a short rolling set; large or regulated environments usually need longer and tiered historyWritten retention periods agreed with compliance, plus deletion evidence and a check that old snapshots are still readable
Off-site or separate-account copyAny cluster where losing the storage account or site would also lose every snapshotSeparate credentials, a separate key, and a periodic test that the copy restores in a different environment
Snapshot taken from a standby or the leaderClusters that need to avoid load on the active node during the capture windowConfirm with the current OpenBao HA documentation which node is used and how the capture behaves during leadership changes

Taking and verifying a snapshot step by step

This sequence produces a Raft snapshot file taken from the active OpenBao node under a narrowly scoped identity, with proof that the file exists and a written record that ties it to a specific point in the cluster's life. Each step ends with a check, so a failed or empty snapshot is caught the same day rather than during a restore.

  1. Confirm the cluster and active node

    Before touching any credentials, the operator confirms which node is active and that the cluster is unsealed and healthy. Run the status and Raft peer listing commands against the cluster address and note which node reports as the leader. Snapshots should be taken from the active node, so a standby address or a load balancer that routes to a standby is the first thing to rule out. Done means you have the active node's address written down and the peer list shows a healthy quorum. Confirm the exact command names and output fields for your release in the OpenBao CLI reference, since they can change between minor versions.

  2. Authenticate with a snapshot-only policy

    The person or automation job logs in with an identity that can only read Raft snapshots, not a root token or a broad administrative token. Create a policy that grants the snapshot capability on the Raft storage path and nothing else, then bind it to a dedicated auth method role such as AppRole for a server job. Log in and confirm the token's attached policies show only the snapshot policy and the default policy. Done means a token with the narrow policy is in hand and a read of an unrelated path is denied. Check the policy path and capability names against the OpenBao policy documentation for your release before you deploy the policy.

  3. Run the snapshot save against the active node

    Run the bao operator raft snapshot save command, pointed at the active node address and writing to a file on a path with enough free space for the cluster's data. The command streams the cluster's Raft state into a single file, so the operator records the exit status and the wall-clock time the command started and ended. Do not run it from an unsealed node you have not confirmed as active. Done means the command exits with success and no error about standby or forwarding appears in the output. Confirm the flag names for your release, since the snapshot subcommand syntax can differ between versions.

  4. Check the file exists and is non-empty

    Verify the snapshot file is present in the target location, has a size greater than zero, and was modified at the time the command finished. A zero-byte or missing file means the save did not complete, even if a wrapper script reported success. Record the file size and the file's checksum with a standard hashing tool so later copies can be compared against it. Done means the file exists, has a non-zero size, and its checksum is written in the run log. Treat a mismatch between the expected and actual size as a failed run and repeat the save.

  5. Test the snapshot can be read

    A file that exists is not yet proof of a usable backup. Inspect the snapshot with the inspection command available in your release, which reads the snapshot header and reports basic metadata without restoring anything. Confirm it parses without error and reports the expected index and term range for the cluster. Run this against a copy in a scratch location so the original is not modified. Done means the inspection output is produced and matches what the cluster reported in the first step. Confirm the inspection subcommand and its output format for your version before automating it.

  6. Record the snapshot ID, time and cluster version

    Write a manifest entry for the snapshot that includes a snapshot ID or file name following your naming convention, the UTC time the save completed, the cluster's OpenBao version, the active node name, the file checksum and the identity used to take it. Store the manifest separately from the snapshot file, so a loss of the file does not also lose its record. The cluster version matters because a restore must be done on a compatible release, and the release notes for your line are the reference for that check. Done means the manifest entry exists and a second person can read it and find the snapshot without asking.

Automating snapshots across environments

On Kubernetes, run the snapshot as a CronJob in the namespace that holds OpenBao, so the job inherits the cluster's scheduling, retry and log collection. The job is a short-lived pod that runs bao operator raft snapshot save and uploads the file to storage outside the cluster. Its design depends on three choices: how the token reaches the pod, which address it uses, and how a failed run becomes visible to a person.

  • Credentials: Give the job a token or AppRole identity whose policy allows only snapshot creation. Deliver the secret through a Kubernetes Secret or an external secrets operator, and keep it out of the container image.
  • Reaching the active node: Point the job at the Service or load balancer in front of the cluster. Read the HA documentation to confirm that snapshot requests succeed through that path in your topology.
  • Failure alerting: Set a backoff limit on the Job, then alert on failed Job objects and on jobs that have not succeeded within the expected window.
  • Overlap control: Set concurrencyPolicy to Forbid so a slow run does not start a second snapshot on top of the first.
  • Storage identity: Use a dedicated ServiceAccount with write access only to the snapshot bucket or path.

Before relying on the job, force a failure in a test namespace and confirm that the alert reaches an on-call channel.

Storing snapshots encrypted and out of reach of routine access

A Raft snapshot contains everything OpenBao stores, so the copy you keep is as sensitive as the cluster itself. The controls below work together: encrypt before the file leaves the node, keep the key apart from the store, make deletion hard, and record every read and write.

Encrypt before upload

Encrypt each snapshot on the backup host before it reaches any shared storage, using a tool your security team has reviewed. Store the encrypted file under a name that does not reveal the cluster it came from. Confirm that unencrypted snapshots never sit in a staging directory, temporary volume or CI artifact store, because a failed upload often leaves a plaintext copy behind.

OpenBao HA docs

Separate key custody from the store

Hold the encryption keys in a system that is not the same account, credential or administrative boundary as the snapshot bucket or file share. Someone who can read the storage should not also be able to read the key. Record who can retrieve the key, who can rotate it, and how you would recover it if the custodian is unavailable during an incident.

Immutable or versioned storage

Enable object lock or an equivalent write-once retention setting, or at minimum versioning with deletion protection, so a compromised backup job or administrator cannot silently overwrite or purge snapshots. Choose a retention period with your recovery point objective in mind, and confirm with the storage vendor how legal holds and early deletion are handled.

Access logging and alerting

Turn on access logs for the snapshot store and forward them to a system your security team monitors. Alert on reads by principals outside the restore group, on deletes, and on policy changes to the bucket or share. Review these logs during restore rehearsals, since a rehearsal is also a test of whether your alerts fire.

Transfer protection

Send snapshots only over encrypted channels with server identity verified, and restrict the backup host's network path to the storage endpoint. Limit the service account to upload and list permissions for the backup path, and keep restore permissions in a separate role that is granted only during rehearsals and real recoveries.

Treat snapshots as secrets

A snapshot can contain the encrypted data and the material needed to reach it, so classify every copy, including local and off-site ones, with the same handling rules as the secrets it protects. Add snapshot copies to your data inventory, define who may hold them, and set a destruction procedure for expired copies. Ask the OpenBao project or your vendor to confirm exactly what a snapshot contains in your version.

How a snapshot moves from cluster to restore target

The flow starts on the active Raft node, which writes a snapshot with bao operator raft snapshot. The snapshot is encrypted before it leaves the cluster and uploaded to a backup store that sits outside the cluster's trust boundary. On restore, the file is fetched and decrypted in a recovery cluster, then unsealed by key holders before anyone trusts the data. Check each hand-off: who can read the backup store, where decryption keys live, and whether the restored cluster answers reads correctly before it goes live.

Snapshot path from the production cluster to a verified recovery cluster, with trust boundaries marked.

Rehearsing a full restore before an incident

A rehearsal proves that a Raft snapshot can rebuild a working OpenBao cluster with the people and steps you would actually use during an incident. It also gives you a measured restore time to compare against the recovery target you set for your own environment.

  1. Provision an isolated target cluster

    The platform team builds a separate cluster in a network segment with no path to production clients or production storage. It must run the same OpenBao version that produced the snapshot, using the same storage backend and a similar node count, so the rehearsal tests the real procedure. Record the exact version with the binary checksum before you start. The step is done when every node reports the same version and the target is not reachable from production networks.

  2. Retrieve and verify the encrypted snapshot

    Copy the most recent snapshot from your backup store into the rehearsal environment using the same retrieval path an responder would use. Confirm the snapshot file's checksum against the value recorded when it was taken, and confirm that the decryption key or wrapping material is available to the people who will need it. The step is done when the checksum matches and the decryption step has been confirmed without touching production keys.

  3. Restore the snapshot with bao operator raft snapshot

    The operator runs the restore command against the initialized target node using the snapshot file, following the procedure in the OpenBao documentation for your version. Watch the command output and the server logs for errors about storage, version mismatches or unexpected seal state. The step is done when the command completes without error and the node reports that it is sealed with the restored data present, ready for unseal.

  4. Complete unseal with the custodians

    Custodians holding unseal key shares, or the operator responsible for an auto-unseal mechanism such as a cloud KMS or HSM, perform the unseal ceremony on the rehearsal cluster. Note any step that depends on a person who is unavailable, a credential stored in only one place or a configuration file that is out of date. The step is done when the cluster reports unsealed and the custodians have written down every gap they found.

  5. Verify secrets, auth methods and policies

    Using an administrative path that does not depend on production tokens, the operator lists the secrets engines, auth methods and policies, then reads a sample of known secrets and confirms that application-facing roles, such as AppRole or JWT roles, still exist with the expected settings. Compare the output with an inventory exported from production before the rehearsal. The step is done when the restored inventory matches the expected inventory, with any differences explained.

  6. Verify audit device configuration

    The operator checks that audit devices are configured as they were in production and that the target can write to them. Confirm that the logging destination exists in the rehearsal environment and that a test request generates an audit entry. Treat a missing or misdirected audit device as a finding, because an incident response team relies on that trail. The step is done when a test operation appears in the expected audit destination.

  7. Record elapsed time and set the recovery target

    Record the time from the start of the snapshot retrieval to the final verification, along with each person and dependency that slowed the process. Compare that figure with the recovery time target your organization has set or intends to set, and confirm the target with the rehearsal result rather than assuming it. Write the findings into the runbook, assign owners to every gap, and schedule the next rehearsal. The step is done when a signed-off record exists and the target has been confirmed or revised.

Security and operational risks in snapshot restores

Restores are where backup design meets security decisions. The six risks below set the questions to answer before a restore runs and during every rehearsal. Each card names a decision or check, and the OpenBao docs are the source for confirming how your version behaves.

Restoring over a live or new cluster

A restore can target the cluster that took the snapshot or a freshly built cluster. Restoring over a live cluster replaces the data its running nodes are serving, so every client, token and lease is affected at once. A new cluster lets you verify the data before clients move. Confirm with the storage docs how a restore interacts with the Raft membership of your existing nodes before you choose.

Storage backends docs

Stale snapshots and lost writes

A snapshot captures state at the moment it was taken, so every write made after that point is lost on restore. That includes secrets created, rotated or revoked since the snapshot. Dynamic credentials issued after the snapshot may still exist in target systems without a matching record in OpenBao. Match your snapshot interval to the amount of change you can accept losing, and reconcile downstream systems after any restore.

Unseal key availability

A restored cluster must be unsealed with keys or an auto-unseal mechanism that matches the data in the snapshot. If the snapshot predates a rekey or a seal change, the current keys may not work. A snapshot alone does not open the data, so store unseal material separately from backups. Test unsealing the restored cluster in every rehearsal, and confirm the behavior for your seal type in the OpenBao docs.

Root token handling after restore

The root token and token state in a restored cluster can differ from what existed when operators last used them. Do not assume a root token from before the incident still works after a restore. Plan an emergency access path that does not depend on a single root token, keep generation procedures documented, and revoke any root tokens created for the restore once it is finished. Confirm how your version handles root tokens during a restore.

Audit log continuity

Audit records show who accessed which secrets and when, so a restore that breaks that record weakens your investigation trail. Confirm whether audit device configuration comes back with the snapshot or must be re-enabled on the restored cluster. Confirm audit devices are active before clients reconnect. Keep logs from the original and restored environments side by side, so you can explain what changed during the restore window.

Revoking leases and tokens after restore

A restored snapshot can bring back leases and tokens that were revoked or expired after it was taken. Dynamic credentials issued in that window may still be valid in target systems. Review lease and token state before users resume work. Revoke what should no longer be valid, rotate static secrets that were exposed or changed, and use bulk revocation where it fits, testing that step during rehearsal.

Questions teams ask about OpenBao snapshot backup and restore

What drives the cost of backing up and restoring OpenBao with Raft snapshots?

The main cost drivers are the time your engineers spend building the snapshot job, the storage that holds encrypted copies, the effort to rehearse a full restore in a non-production environment, and the key custody arrangements that decide who can unseal a restored cluster. Storage cost recurs and grows with retention period and snapshot frequency. Rehearsal and automation work are mostly one-time, although each rehearsal repeats after significant changes. Ask any partner for a quote that lists these components separately, names who performs each task, and states which items are one-time and which recur. Your own infrastructure prices will set the storage figure, so confirm those with your cloud or data center team.

Can our own platform team run OpenBao snapshot backups and restores without a partner?

Yes, if your team can run bao operator raft snapshot save on a healthy leader, store the output securely, and follow a documented restore procedure. The harder parts are operational discipline: scheduling snapshots, alerting when a job fails, keeping copies off the cluster, controlling who holds unseal material, and rehearsing restores on a schedule. Many teams do the first steps in-house and bring in a partner for the automation design, the restore runbook and an independent rehearsal. Decide based on whether you have engineers who have restored a Raft cluster before and whether they can keep the procedure current through upgrades.

What does DeployOpen need from our team to plan and implement snapshot backup and restore?

DeployOpen needs access to the non-production and production environments where OpenBao runs, or to representative copies of them, along with the network paths for the snapshot target and the restore environment. You should name the key holders who will provide unseal material during a rehearsal, the owner of backup storage and retention rules, and the people who approve changes to the runbook. Written scope should also state the Raft cluster topology, the OpenBao version in use and the platform where the cluster runs. Scope, deliverables and timelines are agreed in writing before work starts.

How often should we rehearse a full OpenBao restore?

Rehearse a full restore on a fixed schedule and after any change that affects the snapshot path, the storage target, the unseal method, the OpenBao version or the cluster layout. The exact interval is a policy decision for your risk and compliance owners, so set it in writing and record each rehearsal's result. The OpenBao project publishes version-specific changes, so check release notes before each upgrade and rehearse again if the restore procedure changes. A rehearsal should restore into an isolated environment, confirm that secrets are readable with expected tokens, and time each step so you know your recovery duration.

How do Raft snapshots differ from PostgreSQL backups when OpenBao uses the PostgreSQL backend?

With integrated storage (Raft), the snapshot is a point-in-time copy of the OpenBao data created through bao operator raft snapshot, so it is the backup mechanism you operate. With the PostgreSQL backend, OpenBao data lives in PostgreSQL tables, so your database team's backup and point-in-time recovery tools protect the data, and Raft snapshot commands do not apply. The documentation describes PostgreSQL as easier to operate safely than Raft, which affects how much custom backup work you carry. In both cases, test restores end to end, because a backup you have never restored is unproven. Confirm the backend in your configuration before choosing a procedure.

How should we store OpenBao snapshots so they stay protected?

Store snapshots encrypted, in a location separate from the cluster nodes, with access limited to the people and services that need to restore them. A snapshot contains sensitive OpenBao data, so treat it as a secret-bearing artifact: encrypt it before it leaves the cluster, control key access separately from the storage account, and log reads and deletes. Retention should match your recovery objectives and any regulatory record rules, which your compliance owner should confirm. Keep at least one copy outside the failure domain of the cluster. Note that a snapshot alone may not restore a cluster if the unseal keys or recovery material are unavailable, so plan key custody alongside storage.

Does a DeployOpen engagement guarantee that our OpenBao backups will restore successfully?

DeployOpen does not offer guarantees of restore outcomes, because results depend on your infrastructure, key custody, storage availability and operating practice. What DeployOpen can deliver, within a fixed scope agreed in writing, is the snapshot design, automation, a restore runbook, and a rehearsal in a representative environment with the results recorded. Ask any partner to show how they will verify restores, which evidence you will receive, and what remains your responsibility after handover. Retainers can add recurring rehearsals and upgrade-time checks if you need them on a continuing basis.

How DeployOpen scopes and delivers OpenBao backup and restore

DeployOpen plans, builds, tests and documents Raft snapshot backup and restore for OpenBao inside your own infrastructure. We treat the snapshot job, its encryption and storage, and a rehearsed full restore as one deliverable, so the recovery path is proven before an incident forces it.

How we scope

  • We confirm which OpenBao cluster, Raft nodes and storage locations the snapshot plan covers before work starts.
  • We record snapshot frequency, retention, storage location and recovery targets in a written scope agreed before work begins.
  • Engagements are fixed-scope, with deliverables and timelines set out in writing, and ongoing support is available as a retainer.

How we build

  • We configure scheduled bao operator raft snapshot jobs using the access and token settings your security team approves.
  • We set up encryption of snapshot files and restricted write access to the backup location, then verify both in your environment.
  • We script a full restore into an isolated cluster and record the unseal and token steps your operators must perform.

How we hand over

  • You receive the snapshot runbook, schedule configuration, retention settings and the storage access model in writing.
  • You receive a restore rehearsal report that records the steps run, the elapsed effort and any gaps found during testing.
  • Your operators run a walkthrough of the restore procedure so your team can repeat it without DeployOpen present.

How we support

  • Retainer support can cover snapshot job monitoring, periodic restore rehearsals and review after each OpenBao upgrade.
  • We can retest the restore path after changes to the Raft membership, storage location or encryption keys.
  • Ask any provider to confirm how snapshots are protected from the same key and storage failures that could affect the live cluster.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.