Skip to content

Instantly share code, notes, and snippets.

@rafaelgaspar
Last active November 17, 2017 17:42
Show Gist options
  • Save rafaelgaspar/27370074f0887114208ff6905b581572 to your computer and use it in GitHub Desktop.
Save rafaelgaspar/27370074f0887114208ff6905b581572 to your computer and use it in GitHub Desktop.
Migrate from Consul o Etcd
#!/bin/bash
for key in $(consul kv export | grep "\"key\":" | sed "s/^\t*\"key\": \"//g" | sed "s/\",$//g")
do
echo $key:
consul kv get $key
echo
done
#!/bin/bash
for key in $(consul kv export | grep "\"key\":" | sed "s/^\t*\"key\": \"//g" | sed "s/\",$//g")
do
curl -XPUT http://etcd:2379/v2/keys/$key -d value="$(consul kv get $key)"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment