Skip to content

Instantly share code, notes, and snippets.

@Raboo
Last active August 22, 2017 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raboo/884efd8b9f12899341df1a5e2fad9e73 to your computer and use it in GitHub Desktop.
Save Raboo/884efd8b9f12899341df1a5e2fad9e73 to your computer and use it in GitHub Desktop.
A one liner to migrate data from consul kv to etcd kv.
./consul kv get -http-addr=[CONSUL ADDR]:8500 -recurse | grep : | cut -d: -f1 | while read line ; do ./consul kv get -http-addr=[CONSUL ADDR]:8500 $line |head -c-1 | ./etcdctl --endpoints http://[ETCD ADDR]:2379 set $line ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment