Is export/import of Saved Objects broken?

Hi,
I have Saved Searches, Visualizations, Dashboards created on older Elastic + Kibana version 5.5.0.
I have brought up another setup with latest version 5.6.0.
I want to export all the Saved Objects from 5.5.0 to 5.6.0.
I thought this will be a trivial step to just export it on older setup and import on the new one, but its turning out to be anything but that.
So here it goes:
From 5.5.0 to 5.6.0:

  1. Looks like in 5.5.0 the index pattern was saved as is whereas in 5.6.0 the associated index pattern ID is being saved.
  2. So when I try to import any Saved object, I get an error that index pattern ID not found and click to recreate it.
  3. If I try to recreate it, it fails as it is not able to find the index pattern ID.

Next I wanted to see export/import on same kibana versions.
From 5.6.0 to 5.6.0:

  1. Here I have seen such varying observations, that I am totally confused. Yesterday when I exported a query, I saw index pattern ID in the index field name,
  "kibanaSavedObjectMeta": {
    "searchSourceJSON": "{\"index\":\"AV6D_KbeoINw6SffgU8f\",

And today when I exported new but similar query, I see the index (which is an alias) name

  "kibanaSavedObjectMeta": {
    "searchSourceJSON": "{\"index\":\"debug-indices-alias\",

When i try to import this in another kibana running 5.6.0, it failed as the index alias was already present there (it should not have failed, I am only importing a query).
Anyways to move forward, I deleted the index pattern and tried to import again. It again gave the index pattern ID not found so I re-create the index pattern with the same name. It seemed to succeed but I don't see the query being imported.
Just to add, one or two times in this whole attempt, I was able to get the query imported but I don't really remember with which combination and what precise steps.

So my question is, am I doing anything wrong in exporting/importing Saved Objects or are there issues in this functionality that others have also faced?

-Thanks
Nikhil

So after quite a bit of struggle I finally managed to import my Saved searches, Visualizations and Dashboards.
However there seems to be some issue esp. when you are using index aliases. Few suggestions I can give from my experience is to delete the index pattern, try the operation multiple times if it fails and also wait for some time after any operation.

-Nikhil

Looks like you ran into https://github.com/elastic/kibana/issues/13359

Thanks Mark. Yes, that's what it looks like.
Couple of questions I had though:

  1. Why did I get different pattern IDs (alias name vs auto generated ID) when I exported the same object twice?
  2. How to view the auto-generated pattern ID? I couldn't find any way for this. If I could then i would have edited the json to use that instead.

-Thanks
Nikhil

Export/Import is not meant to be used as a backup/restore or for upgrades. There is quite a bit of data stored in the Kibana index which is not included in the exports. One of these happens to be index patterns.

1.) Since the exports don't include index patterns, you would have had to create a new index pattern in 5.6 which would have used an auto-generated ID. This now does not match your export. You can either update the export and replaces the instances of the other ID, or you can create the index pattern and set the ID to the pattern previously used (click advanced options on the index pattern creation page).

2.) Mangement > Index Patterns, then select the index pattern. The URL should contain the index-pattern ID.

Thanks. I wish I had known this before. Perhaps we can display the auto-generated index pattern ID somewhere on the page itself.

-Regards
Nikhil

Just one last question. If I bring up another setup and want to move all my saved objects there, what is the best way for that? Thanks.

Kibana 5.6.3 has been released which allows for the index pattern to be selected upon import.

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