# Restore kibana json file via curl

**URL:** <https://discuss.elastic.co/t/restore-kibana-json-file-via-curl/164176>\
**Category:** Elasticsearch\
**Created:** [January 14, 2019, 4:34pm UTC](https://discuss.elastic.co/t/restore-kibana-json-file-via-curl/164176 "2019-01-14T16:34:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hanneu](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@Hanneu](https://discuss.elastic.co/u/Hanneu)\
**Post date:** [January 14, 2019, 4:34pm UTC](https://discuss.elastic.co/t/restore-kibana-json-file-via-curl/164176/1 "2019-01-14T16:34:46Z")

</div>

Hello expert,  
I want to backup and restore kibana saved objects via curl command. For backup purpose, I created kibana\_backup.sh which and below is the backup curl command:-

curl --user ericadmin:xxxxx -XPOST "[http://localhost:9200/$KIBANA\_INDEX/](http://localhost:9200/%24KIBANA_INDEX/)_search?size=1000&pretty" -d'{"query":{"match\_all":{}}}' \> $backupdir/kibana\_saved\_objects_$timestamp.json 2\> /dev/null

This generates a kibana\_saved\_objects\_2019\_x\_x.json file. Attached is the json file. ES and Kibana version=5.6.3 . Could you please assist in how can I recover the json file via restore command?

---

<div class="post-metadata">

**Author:** ![Hanneu](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@Hanneu](https://discuss.elastic.co/u/Hanneu)\
**Post date:** [January 14, 2019, 4:43pm UTC](https://discuss.elastic.co/t/restore-kibana-json-file-via-curl/164176/2 "2019-01-14T16:43:51Z")

</div>

[root@labelk ~]# cd /usr/local/scripts/  
[root@labelk scripts]# ls -ltr  
total 8  
-rwxr-xr-x 1 root root 1034 Jan 8 11:08 kibana\_backup.sh  
-rwxr-xr-x 1 root root 363 Jan 8 11:10 kibana\_restore.sh  
[root@labelk scripts]# cat kibana\_backup.sh  
#!/bin/bash  
#########################  
KIBANA\_VERSION=5.6.3  
KIBANA\_INDEX=.kibana  
timestamp=$(date +%F)  
backupdir=/var/backup

# Backup kibana saved objects

curl --user ericadmin:q.3#edsM! -XPOST "[http://localhost:9200/$KIBANA\_INDEX/](http://localhost:9200/%24KIBANA_INDEX/)_search?size=1000&pretty" -d'{"query":{"match\_all":{}}}' \> $backupdir/kibana\_saved\_objects_$timestamp.json 2\> /dev/null

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 11, 2019, 4:43pm UTC](https://discuss.elastic.co/t/restore-kibana-json-file-via-curl/164176/3 "2019-02-11T16:43:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
