Export / import Kibana dashboard and visualizations with a script

Hi, I'm searching how I can export Kibana dashboard and visualisations from my dev environment, so that I can import it later to another environment (in a VM). I want to do that in CLI or with a script.
I found that I can access the kibana config in the .kibana index, but is there a way to get it and easily load it into another instance of kibana ?
Also, can the indices be imported the same way so that the user in prod doesn't have to manually add them on Kibana before adding the dashboard?

Thanks!

There is an API for exporting dashboards along with associated saved objects. There is not official documentation yet because the API is subject to change.

Kibana's existing API for interacting with Kibana saved objects can be explored here

There are a few open issues for better export support https://github.com/elastic/kibana/issues/4288 and https://github.com/elastic/kibana/issues/16831

If the existing APIs do not work out for you then I would recommend writing scripts that just directly make use of ElasticSearch REST APIs to interact with kibana index.

1 Like

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