vault-migrator icon indicating copy to clipboard operation
vault-migrator copied to clipboard

Migration to and from filesystem can have issues with underscores

Open jar349 opened this issue 6 years ago • 2 comments

I have vault backed by consul which I am migrating to filesystem for backup purposes.

If my vault kv has a key named foo and a folder named _foo... both want to become _foo on the filesystem so I get a _foo is a directory error when running vault-migrator.

Since vault is okay with foo and _foo, is there some way to configure the consul file backend to make it handle this case? Do you have any advice that isn't: "don't do that, silly!" :-)

My config.json for vault-migrator --config config.json:

$ cat backup.json
{
    "to": {
        "name": "file",
        "config": {
            "path": "/Users/jar349/projects/vault-backups/data"
        }
    },
    "from": {
        "name": "consul",
        "config": {
            "address": "localhost:8500",
            "path": "vault/"
        }
    }
}

jar349 avatar Aug 07 '18 03:08 jar349

hi @jar349, not much to say. my only suggestion is to name differently keys and folders. is unfortunate that you have that issue, the script only has a job to copy the keys. unfortunately, I have not much time available to fix any incompatibility between backends.

criloz avatar Aug 07 '18 03:08 criloz

In your opinion, where should a fix for this be made? Here, or in the consul file backend implementation?

jar349 avatar Aug 08 '18 14:08 jar349