# Export/import dashboard

**URL:** <https://discuss.elastic.co/t/export-import-dashboard/202594>\
**Category:** Kibana\
**Created:** [October 7, 2019, 9:27pm UTC](https://discuss.elastic.co/t/export-import-dashboard/202594 "2019-10-07T21:27:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SirJune](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sirjune/32/55205_2.png) [@SirJune](https://discuss.elastic.co/u/SirJune)\
**Post date:** [October 7, 2019, 9:27pm UTC](https://discuss.elastic.co/t/export-import-dashboard/202594/1 "2019-10-07T21:27:33Z")

</div>

I am trying to move a dashboard from the default space to another. following this blog ([https://www.elastic.co/blog/how-to-migrate-to-kibana-spaces](https://www.elastic.co/blog/how-to-migrate-to-kibana-spaces))

[root@vm21:/etc/kibana] $ curl -k -u elastic:somepassword [https://vm21:5601/app/kibana#/dashboard/0ced9280-e937-11e9-8780-d10befb3ed2b](https://vm21:5601/app/kibana#/dashboard/0ced9280-e937-11e9-8780-d10befb3ed2b) \> export.json

it created the a file export.json

I then tried to import:  
curl -k -H "Content-Type: application/json" -H "kbn-xsrf: true" -u elastic:somepasswprd [https://vm21:5601/s/testspace1/app/kibana/import](https://vm21:5601/s/testspace1/app/kibana/import) --data-binary @export.json

got a response:  
{"statusCode":404,"error":"Not Found","message":"Not Found"}

i also tried this:  
curl -k -H "Content-Type: application/json" -H "kbn-xsrf: true" -u elastic:somepassword [https://vm21:5601/s/testspace1/api/kibana/dashboards/import](https://vm21:5601/s/testspace1/api/kibana/dashboards/import) --data-binary @export.json

got a response:  
{"statusCode":400,"error":"Bad Request","message":"Invalid request payload JSON format"}[root@vm21:/etc/kibana] $

I'd appreciate any help/tips.

thanks,  
sirjune

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 7, 2019, 9:32pm UTC](https://discuss.elastic.co/t/export-import-dashboard/202594/2 "2019-10-07T21:32:49Z")

</div>

how did you received the dashboard id number?

I have done this via API many time over with different combination. never done it via command line

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 7, 2019, 11:54pm UTC](https://discuss.elastic.co/t/export-import-dashboard/202594/3 "2019-10-07T23:54:52Z")

</div>

I think perhaps you are calling the [export API](https://www.elastic.co/guide/en/kibana/current/dashboard-api-export.html) incorrectly

Looks like you are missing the `export` part of the path?

Also looks like you have `dashboard` singular instead of `dashboards`

The API may have changed slight over versions

`curl -X GET "localhost:5601/api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c" -H 'kbn-xsrf: true'`

---

<div class="post-metadata">

**Author:** ![SirJune](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sirjune/32/55205_2.png) [@SirJune](https://discuss.elastic.co/u/SirJune)\
**Post date:** [October 8, 2019, 3:07pm UTC](https://discuss.elastic.co/t/export-import-dashboard/202594/4 "2019-10-08T15:07:03Z")

</div>

@elasticforme: i followed the blog i mentioned in the original post

@stephenb: you're correct. i missed some in the command line. tired eyes yesterday.  
these allowed me to export/import the dashboard to another space.

- export Dashboard  
curl -k -u elastic:mypassword [https://vm21:5601/api/kibana/dashboards/export?dashboard=42ad2f70-e937-11e9-8780-d10befb3ed2b](https://vm21:5601/api/kibana/dashboards/export?dashboard=42ad2f70-e937-11e9-8780-d10befb3ed2b) \> export.json
- import Dashboard  
curl -k -H "Content-Type: application/json" -H "kbn-xsrf: true" -u elastic:mypassword [https://vm21:5601/s/testspace1/api/kibana/dashboards/import](https://vm21:5601/s/testspace1/api/kibana/dashboards/import) --data-binary @export.json

when i login as testuser (who i gave access to testspace1). It loads the dashboard but a box pops out (lower right corner) with "Unable to update UI setting. Request failed with status code: 403"

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 8, 2019, 7:35pm UTC](https://discuss.elastic.co/t/export-import-dashboard/202594/5 "2019-10-08T19:35:00Z")

</div>

nice it works for me. I just created bash script which can do that backup. sorry for hijacking thread

---

<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:** [November 5, 2019, 7:35pm UTC](https://discuss.elastic.co/t/export-import-dashboard/202594/6 "2019-11-05T19:35:11Z")

</div>

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