In kibana 6.8.0 saved visualizations have an element called uiStateJSON, which has been deprecated in kibana 7 (in https://github.com/elastic/kibana/issues/15204 & https://github.com/elastic/kibana/pull/14949). However, it seems that there is no migration tool and after upgrading to 7 kibana is not able to migrate the kibana index, with error:
FATAL Error: mapping set to strict, dynamic introduction of [uiStateJSON] within [dashboard] is not allowed.
Can someone advise how to update my dashboards (saved as JSON objects and deployed via kibana import dashboards API)?
Unfortunately this doesn't help if uiStateJSON is populated, as their solution was simply to "Edit this JSON file and remove all uiStateJSON elements from the JSON"
Ok, I see. Do you have any warnings related to the migration in the logs? What Kibana version are you migrating to?
Hi @Mikhail_Shustov, thanks for getting back to me.
I am upgrading from 6.8.0 to 7.5.2 and the only error I get in the logs is
"FATAL Error: mapping set to strict, dynamic introduction of [uiStateJSON] within [dashboard] is not allowed"
We have thousands of dashboards, but we have things such as uiStateJSON set to:
"uiStateJSON": "{\"P-1\":{\"vis\":{\"legendOpen\":false}},\"P-2\":{\"vis\":{\"legendOpen\":false}},\"P-5\":{\"vis\":{\"legendOpen\":false}},\"P-4\":{\"vis\":{\"legendOpen\":false}},\"P-6\":{\"vis\":{\"legendOpen\":false}}}",
or
"uiStateJSON" : "{\"P-1\":{\"vis\":{\"colors\":{\"404\":\"#447EBC\",\"2xx\":\"#629E51\",\"3xx\":\"#CCA300\",\"5xx\":\"#C15C17\",\"Bad Request\":\"#447EBC\",\"Other 4xx\":\"#614D93\",\"Unauthorized\":\"#64B0C8\",\"status: 400\":\"#64B0C8\",\"status: 401\":\"#447EBC\",\"status: [200 TO 299]\":\"#508642\",\"status: [300 TO 399]\":\"#CCA300\",\"status: [402 TO 499]\":\"#2F575E\",\"status: [500 TO 599]\":\"#C15C17\"},\"legendOpen\":true}}}",
Is it possible to still set these at the dashboard level in 7.5.2? Is uiStateJSON still ok to use in visualizations (the import dashboard API has uiStateJSON in the documentation - https://www.elastic.co/guide/en/kibana/current/dashboard-import-api.html)?
Thanks,
Steve