Import visualization even with missing fields?

Hi there!

I am trying to do a bulk import of dashboards from an old elasticsearch cluster into a new one. It appears that some of our dashboards/visualizations are not importing as objects, apparently because some of the fields that they query on do not yet exist in the new cluster.

Rather than waiting for the first record containing those fields to be indexed, I would like to import those dashboard & visualization objects now. This seems like it should be possible, and that they should simply return no RESULTS, rather than blocking me from importing, right??

Is there a good way for me to accomplish this?? Maybe by manually adding those objects to the .kibana index via the index api??

This is the error I get from kibana:

Plus stack trace:

Error: Could not locate that index-pattern-field (id: TEST_SUITE_TIME_ELAPSED)
    at FieldAggParamFactory.FieldAggParam.deserialize ()
    at Array.forEach (native)
    at AggConfigFactory.AggConfig.fillDefaults ()
    at new AggConfig ()
    at (native)
    at new AggConfigs ()
    at VisFactory.Vis.setState ()
    at SavedVis._updateVis ()

Thank you!

This is what I was going to suggest trying. Just a word of warning though, there isn't really an official guide for doing this, and invalid changes could render the objects unusable.

I have only tested it on one visualization so far, but it appeared to work for me. I will be running a larger scale test tomorrow.

It worked! I ran "export everything" from kibana, and then used jq (amazing command line json parsing tool, to extract the _id, _type, and _source fields from each object, and then wrote a simple script to run

curl -XPUT http://IPADDRESS:9200/.kibana/${type}/${id} -d${source.json}

and now the vizualizations show up in kibana (most have no data to show, but the object is saved, and when data is added, it appears in any dashboards that viz is used in).