consul icon indicating copy to clipboard operation
consul copied to clipboard

Export/Import KVPs

Open rtaborda opened this issue 10 years ago • 5 comments

Hi, I was wondering if there's any way to easily export the KVPs from one consul deployment and import it into another one? The scenario for this is, for example, when you have a big KVP store in your dev environment and you need to recreate it in another environment

rtaborda avatar Jan 04 '16 12:01 rtaborda

+1 ... this has bitten in more than once. Would be nice to be able to export and import easily.

ssenaria avatar Jan 04 '16 16:01 ssenaria

Hi @rtaborda there's https://github.com/leprechau/consul-backinator which is an open source tool that lets you do this. Also, some folks manage KVS in git and then push them in with tools like https://github.com/Cimpress-MCP/git2consul. If you have multiple datacenters, you can use https://github.com/hashicorp/consul-replicate to sync them. Hope that helps!

slackpad avatar Jan 04 '16 16:01 slackpad

Thank you for your answer, I'll give them a try. But I still don't see why isn't there an export and import option in consul, it could just export the whole kvs as a big json file that then you could also import. This would make the process a lot more easier and user friendly.

rtaborda avatar Jan 06 '16 10:01 rtaborda

I'll give your suggestion some thought as we look at a similar ticket related to backups.

slackpad avatar Jan 06 '16 16:01 slackpad

See https://www.consul.io/docs/commands/kv/import.html and https://www.consul.io/docs/commands/kv/export.html as well as https://www.consul.io/docs/commands/snapshot.html.

slackpad avatar Apr 12 '17 08:04 slackpad