How do I restore an old/deleted Dashboard?

Dim Pap shared this question 1 year ago
Answered

Hi,


I would like to ask if there is a way to restore an old dashboard that it has been deleted.


Thank you,

Dim

Comments (5)

photo
1

Hello Dim,


Thanks for reaching out with your question. The ideal recovery method would be to access a backup of your Yellowfin Configuration Database and restore that backup. That being said, I understand that often times we find ourselves without that exact option.


Don't fret! There is a way to recover deleted items in the Yellowfin Configuration Database. Keep in mind that, before starting this, you need to have full, recent backups of your Yellowfin Configuration Database and your Yellowfin Installation folder. We'll be running some queries against your Yellowfin Configuration Database, and mistakes here can cause irrevocable data loss. This also isn't officially supported or recommended, so do so cautiously! If you're unfamiliar with SQL and how to query a database, please defer this to your local IT Admin or DBA.


There are a plethora of tables in the Yellowfin Configuration Database. For a dashboard, you'll want to look in the 'ReportGroup' table. The 'ShortDescription' field will contain the name of the dashboard, the 'StatusCode' field will show the state of the dashboard.


2d661d5ffe58c0a3def334ba85949bda


You can see my highlighted test dashboard, 'Brush board'. Of course, in a production instance this will be much harder to sort through. In order to find it quickly, we can run a SELECT query against our config db:


  1. SELECT GroupId, StatusCode, ShortDescription FROM ReportGroup WHERE ShortDescription='Brush board';

Of course, you can change this as needed. For example, if you don't know the exact name you may use a LIKE operator instead, or you may SELECT all dashboards WHERE StatusCode='DELETED'. The goal is to find that 'GroupId' as shown:


bcad94371bd0fe5ebc1bb586decfd04f


Now, we see here that the 'GroupId' of the dashboard I've accidentally deleted is 61671. We need this number for our UPDATE query to restore the dashboard:


  1. UPDATE ReportGroup SET StatusCode='OPEN', EndDate='9999-12-31' WHERE GroupId=61671;

It's very important that the above query is run with the GroupId, as that's the primary key of the table. This ensures that only the specified dashboard is updated.


After you've successfully run this query, you need to restart Yellowfin to pick up the changes. Your dashboard will no longer be a permanent tab in the personal dashboard of any of your users. You'll have to access it through the Browse page and add it back, or assign it through other means. The good news is, however, that your dashboard will be back!


Let me know how this goes.


Thanks,

Ryan

photo
1

Hi Ryan,


thank you very much!! I could successfully restore the Dashboard as you showed me.

In that Dashboard, some reports that were used have also been deleted. I assume that if I do the same procedure for the reports I will find them again.

How can I know which there reports were? Is there any field in the DB that shows the relationship between the Dashboard and the Reports (and maybe the views of the reports)?


Thank you again and have a nice day,

Dim

photo
1

Hello Dim,


I'm glad to hear that you were able to recover your dashboard. On the subject of determining which reports were part of your dashboard, it's easy to find ourselves "off in the weeds" when determining this. I'll give a quick synopsis of where we would look and a theoretical process of determining the report names.


First and foremost, the relationship between a report and a dashboard will be found in the "ReportGroupEntity" table. This table will contain the "GroupId" joining the "ReportGroup" table and the "EntityId" joined on the "ReportId" of the "ReportHeader" table. This alone is more or less up front.


Keep in mind that if your dashboard contains any subtabs, those will have their own unique "GroupId" in "ReportGroup". This is denoted by the value of "GroupTypeCode" being set equal to "SUBTAB".

151947b08afb351a6994ee2b2c57e0bf


If your dashboard contained any subtabs, the "ReportId" values will be joined on the subtab "GroupId". In example, the analytic dashboard "Campaign Analysis" has a "GroupId" of 61788. I've garnered from the layout of the records within the "ReportGroup" table that this dashboard contains two subtabs: 61835 and 61836. Jumping back over to the "ReportGroupEntity" table, when I filter on the "GroupId" of this main dashboard, I only have two entries:


2be291dc07f74163d04aae8f3ee91638


You'll notice that they are both "SUBTAB" entries. Therefore, in order to determine which reports were on the parent dashboard, I would have to query for each sub tab and determine this way. Filtering "GroupId" on the value 61835 (the first subtab) will show me the reports that were part of that subtab:


843fecb1e6a16e4d19ee67187c0fab53


Doing this for each subtab "GroupId" would essentially give me the required "EntityId" values to join back to the "ReportHeader" table to find my report names.


For a standard dashboard, you need only filter on its own "GroupId".


That being said, let's use my example above. I'm given five different "EntityId" values by filtering on said dashboard > subtab. In order to pull up the report records to determine some meaningful value, I'll query the "ReportHeader" table.


  1. SELECT * FROM ReportHeader WHERE ReportId in (59709, 59806, 59838, 59850, 60189);

Resulting in the output of the report details, allowing me to view their names:


862a63e64dbdb4fe3b8189ef3328a80b


Note the field in the return of this query called "ReportStatusCode". If a report has been deleted, the value of this should be 'DELETED'. To restore the report, you can simply run an UPDATE query to change this to 'OPEN' and restart Yellowfin. When doing so, reference the reports directly by their "ReportId" to avoid mistaken updates.


  1. UPDATE ReportHeader SET ReportStatusCode='OPEN' WHERE ReportId in (59709, 59806, 59838, 59850, 60189) AND ReportStatusCode='DELETED';

Give this a try and let me know how everything goes.


Thanks,

Ryan

photo
1

Hi Ryan,


thank you very much for the detailed info!

I could successfully find the reports used in a Dashboard which is really helpful for the existing Dashboards as well!!! :D


Thank you again,

Dim

photo
1

Hello Dim,


Thanks for the update. I'm glad you were able to come to a resolution. I'll go ahead and mark this as Answered, however if you have any further questions or issues don't hesitate to contact us.


Thanks,

Ryan