How to reset or "un-initialize" vault?

Per the discussion of this same question here: https://groups.google.com/forum/#!msg/vault-tool/xuO8IInubDg/SBHMP2PKAwAJ, the answer is:

Vault is storing its state in Consul, so if you shut down Vault and delete Vault's key prefix in Consul things should start clean again.


With any storage backend of Vault you should be able to just delete your storage. Looks like you were running into an bug with that older version of Consul.


Just in case someone reads this post with the same intention as I did -> looking for "file"-backend or "database"-backend

file backend:

If you look into the vault configuration file (e.g. /etc/vault.d/vault.hcl)

There is a directive storage "file" { path = "/some/file/name" ......

Just empty the directory /some/file/name (do not remove, just emtpy).

database backend:

you just have to truncate the "vault_kv_store" table and restart vault:

psql -U myvaultdbuser -h myvaultDB.host.name -p5432 vaultdatabasname -c 'truncate table vault_kv_store';

... and to initialize again:

Then direct your Browser to e.g. http://localhost:8820/ui/vault/init to initialize it again