<p>I'm trying to migrate our Hashicorp Vault standalone with storage type <code>file</code> running in our RKE2 cluster to a Hashicorp Vault HA with storage type <code>raft</code>. But still getting some issues. <a href="https://artifacthub.io/packages/helm/hashicorp/vault" rel="nofollow noreferrer">We're using the Helm chart version 0.22.0</a>. So these are the steps I followed:</p>
<ol>
<li>Create a temporary Vault Raft running in RKE2 with 1 replica (don't initialize vault)</li>
<li><code>Exec</code> into the old Vault container with the storage type <code>file</code></li>
<li>Go to the <code>/vault/</code> folder and create a <code>raft</code> folder in it</li>
<li>Run the command <code>vault operator migrate --config migrate.hcl</code>
The migrate.hcl file looks like this:</li>
</ol>
<pre><code>storage_source &quot;file&quot; {
  path = &quot;/vault/data/&quot;
}

storage_destination &quot;raft&quot; {
  path = &quot;/vault/raft/&quot;
  node_id = &quot;vault-raft-0&quot;
}

cluster_addr=&quot;https://127.0.0.1:8201&quot;
</code></pre>
<ol start="5">
<li>The migration is complete and it created a <code>vault.db</code> file into <code>/vault/raft/</code> and a <code>raft.db</code> file into <code>/vault/raft/raft/</code> including an empty folder called <code>snapshots</code>.</li>
<li>Then I copied this whole <code>/vault/raft/</code> folder to my local pc and copied it again to the temporary Vault Raft container. It has the same data storage mount path, so: <code>/vault/raft/</code></li>
<li>After copying the files I re-deployed the temporary Vault Raft since the pvc won't be deleted and checked if it has still the copied <code>.db</code> files in it.</li>
<li>In the end I tried to unseal it, but after running the third command Iit returns the following message: <code>Error unsealing: context deadline exceeded</code></li>
</ol>
<p>Am I doing something completely wrong?</p>

Lucas Scheepers
<p>Maybe it's a little bit late, but working flow for me sounds like this:</p>
<ol>
<li>create migrate.hcl with content :</li>
</ol>
<pre><code>storage_source &quot;file&quot; {
 path = &quot;/vault/data/&quot;
}
 storage_destination &quot;raft&quot; {
 path = &quot;/vault/data/&quot;
}
cluster_addr = &quot;https://vault-0.vault-internal:8201&quot;
</code></pre>
<ol start="2">
<li>Then run <code>vault operator migrate -config=migrate.hcl</code></li>
<li>Uninstall your previous deployment.</li>
<li>Install deployment with raft enabled.</li>
<li>At the vault-0 run <code>vault operator unseal</code></li>
<li>At the other pods run <code>vault operator raft join http://vault-0.vault-internal:8200</code> and <code>vault operator unseal</code>.</li>
</ol>
<p>This worked for me</p>
