How to migrate from HashiCorp Vault to OpenBao

Move from HashiCorp Vault to OpenBao: choose in place or a copy, rebuild the configuration as code, copy KV secrets by script, move clients one by one.

Start with one workloadThe steps

Written for
The engineer who will do the work
Or run by Pilae
At a fixed price, then operated

In short

  • OpenBao keeps the Vault API down to the X-Vault-Token header, so most applications need a new address and a fresh login rather than new code.
  • OpenBao documents an in-place swap only for a Vault Community cluster on the one release it tested, with Raft storage and a Shamir seal. Every other Vault moves by copy into a new cluster.
  • In a copy, the configuration is rebuilt as code and KV secrets are copied by script. Tokens, leases, Enterprise replication and Sentinel policies do not come across.
  • Vault stays up while clients move one at a time, and each client’s leases are revoked in Vault once its audit log shows no more calls from that client.
On this page (10)

Moving from HashiCorp Vault to OpenBao is a re-pointing of clients, with the data copied rather than converted. OpenBao keeps the Vault API, down to the paths and the X-Vault-Token header, so applications and their client libraries mostly need a new address and a fresh login, not new code. The stored data is another matter. OpenBao documents an in-place swap for one narrow case, a Vault Community cluster on the one release its maintainers tested. Everything else moves by copy into a new OpenBao cluster: the configuration rebuilt as code, the static secrets copied by script, and the clients moved one at a time. This guide covers the order we do it in, and what does not come across.

Why teams move from HashiCorp Vault to OpenBao

Three reasons come up again and again.

  • An open-source licence. HashiCorp moved Vault to the Business Source License in 2023. OpenBao was forked from the last MPL-2.0 code before that change, is still MPL-2.0, and is hosted by the OpenSSF, part of the Linux Foundation.
  • One edition. Namespaces and standby nodes that answer reads are Vault Enterprise features. OpenBao has both in its only release, along with auto-unseal against an HSM through its PKCS#11 plugin, with no licence fee.
  • Keys you hold. OpenBao runs on machines you choose, and the seal is your HSM, your KMS or key shares held by your own people. On HCP Vault Dedicated, HashiCorp operates the cluster and creates the KMS key that seals it.

What you give up is real. Vault Enterprise replication, for disaster recovery or for performance, has no equivalent, nor do Sentinel policies or Enterprise secrets engines such as Transform, KMIP and Key Management. Several plugins that Vault bundles are not shipped by OpenBao, and step 1 is where you find out whether you use one. HashiCorp’s Terraform provider for Vault works against OpenBao for most tasks, but not all. And someone has to run the cluster, which is the part Pilae takes on.

Step 1: inventory mounts, policies and callers

Read the configuration from Vault itself before anything moves.

  1. Mounts. vault secrets list -detailed and vault auth list -detailed list every secrets engine and auth method with its path, type and plugin. vault plugin list shows the plugins registered in the catalogue. On Vault Enterprise and HCP Vault Dedicated, repeat both in every namespace (vault namespace list).
  2. Policies. vault policy list and vault policy read <name> give the ACL policies. On Enterprise, Sentinel policies live under sys/policies/egp and sys/policies/rgp, and have no OpenBao counterpart.
  3. Callers. Vault’s audit log records every request with its path, the mount type, the client’s remote address and the display name of the token that made it. A few weeks of it show which mounts are live, which applications call them and how they log in. Mounts nobody calls are left behind.

Then check each mount type against what OpenBao ships. Plugins that moved out of the main binary are published in the project’s openbao-plugins repository and declared in the server configuration.

In Vault In OpenBao
KV, transit, PKI, SSH, TOTP, Kubernetes and RabbitMQ secrets; database plugins for PostgreSQL, MySQL and MariaDB, Cassandra and InfluxDB Built in
AppRole, JWT and OIDC, Kubernetes, TLS certificate, userpass and token auth Built in
LDAP, Kerberos and RADIUS auth; LDAP secrets Plugin from openbao-plugins
AWS, Azure and GCP auth and secrets; GitHub auth; Consul, Nomad and GCP KMS secrets; the MongoDB database plugin Plugin from openbao-plugins
Okta, Cloud Foundry, Alibaba Cloud and OCI auth; database plugins for Microsoft SQL Server, Snowflake, Redshift, Elasticsearch, HANA, Couchbase and MongoDB Atlas No plugin from the project: rebuild or keep apart
Transform, KMIP and Key Management secrets, Sentinel, replication, secrets sync Vault Enterprise only: no equivalent

People who signed in through Okta auth sign in through OIDC instead, against Okta or the identity provider that replaces it. A database whose plugin has no OpenBao counterpart keeps its credentials elsewhere, or waits for a plugin you build and maintain against OpenBao’s plugin interface.

Step 2: choose between in place and a copy

Two routes from Vault to OpenBao

In place

  • Vault Community on the one release OpenBao tested
  • Integrated Raft storage
  • Shamir unseal
  • No mount whose plugin OpenBao lacks

Copy into a new cluster

  • Every newer Vault release
  • Vault Enterprise and HCP Vault Dedicated
  • Auto-unseal, or storage other than Raft
  • Mounts that need a plugin OpenBao does not ship

OpenBao’s in-place migration guide replaces the Vault process on each node of a Vault Community cluster and keeps the data, the addresses and the configuration. Its constraints are narrow: the one Vault Community release it was tested against, integrated Raft storage, a Shamir seal and no external plugins. It calls newer Vault releases untested and unsupported, and states that OpenBao makes no guarantees about storage compatibility with Vault. Vault Enterprise was not tested. A mount whose plugin OpenBao does not include is skipped when OpenBao starts: it is still listed, but every read returns No value found.

When a cluster fits, the guide’s order is: back up with a Raft snapshot, then install and configure OpenBao on every node with a new storage path, without starting it. Then, one follower at a time, stop Vault, start OpenBao, run bao operator raft join and bao operator unseal, and wait until bao operator raft list-peers shows the node as a voter. The leader goes last, after vault operator step-down. Existing Vault tokens stay valid until their TTLs run out, and new tokens take OpenBao’s format.

Everything else moves by copy, the route the rest of this guide follows. That includes HCP Vault Dedicated, which HashiCorp describes as a hosted version of Vault Enterprise. Its snapshots are created and restored inside HCP, its seal is a KMS key HashiCorp creates for each cluster, and OpenBao documents no way to restore one.

Step 3: build the OpenBao cluster beside Vault

Settle what is hard to change later before any data arrives.

  • Storage. Integrated Raft on three or five nodes, which serves only while a majority is up, or PostgreSQL where you already run a replicated cluster. OpenBao’s documentation recommends PostgreSQL to teams new to running it.
  • Seal. Without a seal stanza, OpenBao uses Shamir, and every node that restarts waits for key holders to unseal it. Auto-unseal wraps the root key with a key held outside: an HSM over PKCS#11 or a cloud KMS, each installed as a KMS plugin from openbao-plugins, or the transit engine of another OpenBao, which is built in. With auto-unseal, losing that key loses the data, and recovery keys do not bring it back.
  • Initialisation. bao operator init with -pgp-keys for Shamir shares, or -recovery-pgp-keys for the recovery shares of an auto-unseal cluster, encrypts each share to the PGP key of a person you name, so nobody sees the shares in the clear. Revoke the initial root token once setup is done.
  • Audit devices. Declare them in the server configuration with an audit stanza: OpenBao disables creating audit devices through the API by default. It also refuses requests when no enabled audit device can record them, so ship the log off the node and alert on disk space.
  • Sign-in for people. The JWT/OIDC auth method signs people in through Keycloak or another OpenID Connect provider, in the web UI or with bao login -method=oidc. Register two redirect URIs with the provider: https://<openbao-host>:8200/ui/vault/auth/oidc/oidc/callback for the web UI, with the method mounted at oidc, and http://localhost:8250/oidc/callback for the CLI. Map the groups claim to OpenBao external groups, which carry the policies.

Step 4: rebuild the configuration as code

The copy route reads nothing from Vault’s storage, so the configuration is rebuilt from the step 1 inventory and kept in your repository.

  1. Namespaces first, on the same paths, so clients that send X-Vault-Namespace keep sending the same value. On HCP Vault Dedicated everything sits under the admin namespace: create admin in OpenBao to keep every path unchanged, or drop it and remove the namespace setting from each client.
  2. Mounts on the same paths, with the same types and tuning, including their lease TTLs. Keep each KV mount on the same KV version.
  3. Policies. ACL policies use the same HCL and copy across as text, from vault policy read to bao policy write. Sentinel rules are rewritten as ACL policies or enforced elsewhere.
  4. Auth roles: AppRole, Kubernetes, certificate and OIDC roles, and the identity groups they map to.
  5. Secrets engine settings: database connections and roles, PKI roles and SSH roles. If Vault rotated a database connection’s root credential, only Vault knows that password, so OpenBao’s connection gets a database account of its own.

If Vault is already configured with HashiCorp’s Terraform provider for Vault, the shortest route is often the same code applied to the new cluster, with the provider’s address pointed at OpenBao. OpenBao’s own proposal for a dedicated provider says HashiCorp’s provider still works for most tasks against OpenBao, with gaps where the two have diverged. Run a plan against the empty OpenBao cluster first and fix each resource that fails, and remove the resources for Enterprise-only features. OpenTofu uses the same provider.

Step 5: copy static secrets and keys

Only static data is copied. Dynamic credentials are not: OpenBao issues its own from the connections rebuilt in step 4.

KV secrets are read from Vault and written to OpenBao by script, path by path. The two CLIs are enough, with one trap: bao reads BAO_ environment variables and falls back to VAULT_ ones when they are unset, so a script that sets only VAULT_ADDR writes back into Vault. Set both.

# Copy the current version of every secret in the KV v2 mount at secret/
export VAULT_ADDR=https://vault.acme.internal:8200 VAULT_TOKEN=...  # source, read and list only
export BAO_ADDR=https://bao.acme.internal:8200 BAO_TOKEN=...        # target

copy() {
  vault kv list -format=json "$1" | jq -r '.[]' | while read -r key; do
    case "$key" in
      */) copy "$1$key" ;;
      *) vault kv get -format=json "$1$key" | jq '.data.data' | bao kv put "$1$key" - ;;
    esac
  done
}
copy secret/

The script copies the current version of each secret. Version history, deleted versions and custom metadata stay in Vault, so copy them separately if anything relies on them. Then compare: walk both sides the same way and diff each path’s JSON, sorted, before any client reads from OpenBao.

Transit keys decide whether data encrypted through Vault can still be decrypted. Vault’s backup endpoint (transit/backup/<key>) works only for a key marked exportable with plaintext backup allowed, two settings that cannot be turned off once set, and OpenBao’s transit/restore endpoint takes a backup as its input. Test a Vault backup on one key in a scratch cluster before relying on it. The alternative is to decrypt each value through Vault and encrypt it again through OpenBao, before Vault goes.

PKI. A CA key Vault generated internally does not leave it. Generate a new intermediate CA in OpenBao and have your root sign it, wherever the root lives. Certificates Vault already issued stay valid until they expire, and any that name a Vault address for their CRL or issuing certificate need that address to keep answering until then.

What stays behind: tokens, leases, AppRole secret IDs, identity entities, which OpenBao creates again at each first login, KV version history and Vault’s audit log.

Step 6: move clients one at a time

Each application moves on its own, starting with one whose failure would hurt nobody.

Moving one client

  1. Point: The client’s Vault address changes to OpenBao’s.
  2. Log in: It authenticates against OpenBao and receives an OpenBao token.
  3. Read: Static secrets come from the copy, dynamic credentials are issued fresh.
  4. Watch: Vault’s audit log shows no more requests from the client.
  5. Revoke: Its leases in Vault are revoked.
  • The address. OpenBao intends to stay API-compatible with Vault and says most existing Vault client libraries should work with it. Change the address, and the namespace if step 4 changed it. Scripts can keep VAULT_ADDR, which bao reads when BAO_ADDR is unset.
  • Logging in again. Clients that authenticate with an identity they already hold need no new credential: Kubernetes service accounts, JWTs from your CI, TLS certificates and OIDC sign-in all work against the roles rebuilt in step 4. AppRole needs a new secret ID delivered to each client. Its role ID can stay the same, because OpenBao lets you set a role’s ID to the value Vault used.
  • The token format. OpenBao issues tokens as s., b. or r. followed by a random body, shorter than Vault’s hvs., hvb. and hvr. tokens. Anything that checks a token’s prefix or length, from a secret-scanning rule to a validation in your own code, is found in testing.
  • Agents. Vault Agent and Vault Proxy have OpenBao counterparts, bao agent and bao proxy. Each sidecar or host agent moves with the application it serves.
  • Dynamic credentials. A database user created by Vault and one created by OpenBao exist side by side until the Vault lease is revoked, so the application reconnects with OpenBao’s credentials before step 7 removes Vault’s.

Step 7: revoke leases and retire Vault

  1. Revoke each moved client’s leases in Vault once it reads from OpenBao. vault lease revoke -prefix database/creds/<role> revokes every lease under that prefix, and the secrets engine removes the credentials behind them. Left alone, they stay valid until their TTL runs out, by default up to 32 days.
  2. Watch the audit log until no client calls Vault over a full cycle, monthly and quarterly jobs included.
  3. Keep a record. Take a final snapshot and archive the audit log, with the unseal or recovery keys that open the snapshot, for as long as your rules require.
  4. Switch Vault off, then end the licence or the HCP subscription.

Running OpenBao in production

A secrets store is the system every other system waits on when it starts.

  • Three or five nodes. Raft needs a majority to serve, so three nodes survive the loss of one and five survive two. Every write waits on that majority, so the nodes want SSDs and no burstable CPU or disk.
  • Snapshots with their seal. A Raft snapshot (bao operator raft snapshot save) restores nothing without the seal that encrypted it, so a restore test needs both.
  • Upgrades without a way down. OpenBao promises no downgrade, so the way back is the previous binary and the snapshot taken just before. Plugins from openbao-plugins have releases of their own, so each upgrade checks them too.

Pilae operates OpenBao on three or five dedicated machines, on your own hardware next to your HSM or in a Pilae Cloud region you choose, answering only on your private network. The unseal or recovery key shares are encrypted at initialisation to the PGP keys of people you name, so Pilae holds neither a share nor the key. Snapshots go offsite daily, encrypted, to a location in the country your contract names, and on Enterprise a restore test every month is recorded in the console. The Pilae Agent rehearses each upgrade on an isolated copy, waits for your approval and applies it standbys first, in your window.

Let Pilae run the move

Pilae runs HashiCorp Vault to OpenBao migrations at a fixed price: the inventory of mounts and callers, the cluster and its seal, the configuration as code, the secret copy checked path by path, and the move of every client until Vault is switched off. Then we operate OpenBao for you under a contract that, from the Business plan, includes a monthly availability commitment with service credits. See migration services for what the fixed price covers, or tell us about the Vault you run and we will scope it.

Questions

Can we upgrade Vault to OpenBao in place?

Only in one narrow case. OpenBao documents an in-place swap for a Vault Community cluster on the one release its maintainers tested, with integrated Raft storage, a Shamir seal and no plugins OpenBao lacks. It calls newer Vault releases untested and unsupported, and makes no promise of storage compatibility with Vault. Every other cluster, Vault Enterprise and HCP Vault Dedicated included, moves by copy into a new OpenBao cluster.

Do our applications need code changes?

Usually not. OpenBao keeps the Vault API, its paths and the X-Vault-Token header, and most client libraries written for Vault work against it. Applications get a new address and log in again. Check anything that expects the Vault token format, because OpenBao tokens start with s., b. or r. and are shorter, and any mount that depends on a plugin OpenBao does not ship.

Do tokens and leases come across?

Not in a copy. Clients log in to OpenBao and receive new tokens, and OpenBao issues dynamic credentials of its own. The leases Vault issued stay with Vault until they expire or are revoked there, which is why each client's leases are revoked in Vault once it has moved.

What happens to Vault Enterprise namespaces, replication and Sentinel?

OpenBao has namespaces, and they are created again on the same paths, so clients keep sending the same X-Vault-Namespace header. Replication between clusters, Sentinel policies and Enterprise secrets engines such as Transform and KMIP have no equivalent: Sentinel rules are rewritten as ACL policies, and a second site is a restored snapshot rather than a live replica.

Is OpenBao open source?

Yes. OpenBao is MPL-2.0, an OSI-approved licence, and there is no paid edition holding features back. It was forked in 2023 from the MPL-2.0 code of HashiCorp Vault, when HashiCorp moved Vault to the Business Source License, and it is hosted by the OpenSSF, part of the Linux Foundation. Plugins that moved out of the main binary are published by the project in its openbao-plugins repository.

How long does a Vault to OpenBao migration take?

It depends on the number of live mounts and on how many clients call them, not on the number of secrets: a script copies a whole KV mount in one pass, but each application moves on its own. The inventory in step 1 settles the scope, and Pilae quotes the whole move at a fixed price once it is done.

Let us run the move for you

An inventory, a parallel run and a cutover plan, at a fixed price. Then we operate the app.

Start with one workload

  • Go deeperSaaS migrationA fixed-scope migration off Google Workspace, Microsoft 365, Zapier, Airtable and ChatGPT to open-source apps, with a parallel run and a cutover plan.
  • CheckManaged operationsPatching, daily encrypted backups, monitoring and incident response for your open-source apps, under an SLA with an availability commitment of up to 99.9%.