Can I copy a dashboard and its associated visulizations?

ELK Version: 5.4.1

There some similar projects, and they could use same dashboard.

You mean you want to duplicate existing dashboards/visualizations, or you want to export them from one Kibana instance and import them into another.

If the later, there's an export function in Management > Saved Objects.

The first...I want to duplicate existing dashboards.

This is a feature ('Clone') in their Premium X-Pack but not in standard Kibana as of now.

I have installed xpack, how to use this feature, but I didn't find the buttons... is there a guide?

There should be a clone button right in the middle of Share and Edit, on the top-right corner of every dashboard.

I have no this button, maybe I should use Enterprise version? my xpack is trial now...

Maybe it a new feature in 5.5.0, you should try that.

OK, thanks a lot, I will have a try.

I am not sure if that's what you mean, but when I need to duplicate an existing dashboard, I open it, go to Edit -> Save -> Save as new dashboard and enter a new name for the second dashboard. Afterwards, you should see both of them in the menu.

This what I am doing now, but the visualizations are the same, also I need to copy the associated visualizations.

This is a feature ('Clone') in their Premium X-Pack but not in standard Kibana as of now.

That's not true. The clone operations is part of Kibana. It's just new, and does the same thing as the "Save as new dashboard".

As Helix pointed out, you can "Save as new dashboard", and that will create a copy of the dashboard, but as you note, it will not create a copy of the underlying visualizations. You'd have to also make copies of all of those, and use those cloned visualizations on your cloned dashboard.

You can do this through the UI, but it's a lot of work. Since everything is just a document in Elasticsearch, it would be much easier to script this.

  • Read the dashboard (a GET operation by ID)
  • Read the visualizations on it (an MGET here)
  • Make a new copy of the visualizations, setting a new ID (the ID can be anything, Kibana just uses a UUID by default, you can do the same)
  • Make a new copy of the dashboard as above, and also change the IDs of the visualizations in it to the copies you just created

This could also be built into a plugin in Kibana if you wanted to do it that way. That would allow you to keep a single interface for managing this stuff, instead of copying a dashboard ID into an external script. You could even create a new control at the top of dashboards that would do all of this right from there.

Since it was pointed out that the Clone operation already exists in Kibana, I think it's reasonable to make a feature request there that would clone the visualizations automatically too. The operation is the same whether Kibana does it or you write your own script to do it.

1 Like

Hi Joe, thanks a lot for your explanation, hope you release this new feature in next version.

I probably wasn't clear enough. I'm saying you should open an issue in the Kibana repo to add that functionality. That way someone on the team, or even someone from the community, will see the request and actually make it happen. I'd open it myself, but features are more meaningful when they come from our users.

1 Like

OK, I will open a issue about this in github.:smile:

Upgrade kibana to 5.5.1 and I found the Clone button, thanks a lot for your advice!

I have a try to clone a dashboard, and it seems that the visualizations are just links to the original dashboard, if I modify the visualizations, the original dashboard will be changed too.

A quick method would be to :-

  1. Export the visualizations from management -> Saved Objects,
  2. Edit their IDs (_id) in the JSON obtained and then import those visualizations.
  3. Same way, export the dashboard and match the new IDs in "panelsJSON", (You can just append '-clone' at the end of every _id in visualizations and dashboards) and that should work like a charm upon importing.

This way you have just cloned all your visualizations and the dashboard.

See, Kibana stores all it's data in Elasticsearch under '.kibana' index. The Visualizations are under 'visualization' type and then we have :- dashboard, url, index-pattern, etc. And these Objects can reference each other, like Dashboards will be referencing the IDs of their visualizations and visualizations will be referencing their searches, etc. So if you clone a dashboard, only dashboard Object is cloned as it is, it's references remains the same.

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