Recovering a deleted fixlet

We recently faced an issue with deleted fixlet and had to figure out a way to recover them.
If you have the ID or fixlet name, it can be recovered using below sql commands

select SiteID, ContentID, IsDeleted, Name from dbo.CUSTOM_FIXLETS where SiteID=<site id> and ContentID=<fixlet id if you have> and Name like '%<part of fixlet name here>%'

site id can be retrieve by

select ID from dbo.SITES where Name = '<site name>'

Once you have the content id i.e. fixlet id, you can undelete the fixlet using below queries

update dbo.CUSTOM_FIXLETS set IsDeleted=0 where ContentID=<fixlet id>

update dbo.LOCAL_OBJECT_DEF set ParentID=0 where SiteName=<site name> and ID=<fixlet id>

both these update queries should be run for undeleting the fixlet.

Other than these, always ensure you are backing up your database nightly.
If you are unfamiliar or do not feel comfortable working with database directly, better option is to export all custom fixlets on a daily basis.
https://forum.bigfix.com/t/query-for-finding-who-deleted-tasks-fixlets/13668

Hope its helps someone :slight_smile:

7 Likes