Created
March 8, 2016 14:22
-
-
Save shanielh/828d9750dd3a082df9f9 to your computer and use it in GitHub Desktop.
consul migrate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Consul KVP migration tool requires jq, base64 and curl | |
# sudo apt-get update && sudo apt-get install -y curl jq # coreutils (Comes with ubuntu) | |
echo "Migrating consul from $1 to $2" | |
curl "http://$1:8500/v1/kv/?recurse" | jq 'map("curl \"http://NEW_ADDR:8500/v1/kv/\(.Key)\" -XPUT -d \"$(echo \"\(.Value)\" | base64 --decode)\"")[]' -r | sed "s/NEW_ADDR/$2/g" | sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment