Corrupted Kibana Saved Object

Hey, Can anyone please tell me how to check the corrupted saved object of kibana?
Context: I'm intended to upgrade kibana. If any kibana saved object is corrupt then upgrade fails, so its workaround is to manually find the name of corrupt object from kibana error logs and delete it using API query. So I want to see if I could find a way to check all corrupt objects before stating upgrade. Thank you

Let's say you upgrade from 7.13 to 7.14.
One way that comes to my mind is to export all your saved objects in 7.13 in Stack Management/Saved objects to ndjson file and then import it in a different Kibana instance in version 7.14. This however might be more work than upgrading and deleting.

I was asking like is there any command / query to check how many of saved objects are corrupted and what are they? So that I can just manually delete them before starting upgrade.

Hi Zafar,

There isn't currently a way to do this, but we are planning to add it. We call this a "migration dry run" and tracking it in https://github.com/elastic/kibana/issues/55404

It might be helpful to know that corrupt saved objects can only be created by writing directly to the .kibana index. If you use the saved objects HTTP API instead, you'll avoid any future corrupt documents being created.

Alright! Thank you