1--- 2layout: commands 3page_title: 'Commands: KV Export' 4--- 5 6# Consul KV Export 7 8Command: `consul kv export` 9 10The `kv export` command is used to retrieve KV pairs for the given 11prefix from Consul's KV store, and write a JSON representation to 12stdout. This can be used with the command "consul kv import" to move entire 13trees between Consul clusters. 14 15## Usage 16 17Usage: `consul kv export [options] [PREFIX]` 18 19#### API Options 20 21@include 'http_api_options_client.mdx' 22 23@include 'http_api_options_server.mdx' 24 25#### Enterprise Options 26 27@include 'http_api_namespace_options.mdx' 28 29## Examples 30 31To export the tree at "vault/" in the key value store: 32 33```shell-session 34$ consul kv export vault/ 35# JSON output 36``` 37