Knowledge Drop

How can I recover a deleted Look or Dashboard if the trash is emptied?

  • 5 April 2021
  • 2 replies
  • 2298 views

Userlevel 5
Badge
  • Looker Staff
  • 171 replies

Last tested: March 2021

 

 

As of 4.8+, all deleted content goes to the Trash Folder. It stays there indefinitely until deleted by an admin. Any content can be restored from the Trash Folder by an admin.

This card talks about how to find and restore a deleted Look or dashboard with i__looker, in the case where the deleted content has also been deleted from the Trash.

If you accidentally deleted a Look or dashboard AND deleted the trash, it's possible to recover this Look or dashboard using Looker's internal model, i__looker. i__looker is the model underlying the Usage Panel in the Admin section.

Recovering a deleted Look that is no longer in the trash

  1. Go to the history explore of the i__looker model. You can get there by navigating to a URL of the form:

 https://company.looker.com/explore/i__looker/history

Replace company.looker.com with your Looker instance's specific URL.

  1. If you know a specific time that the Look was queried, filter on History - Created Time for as specific a range as possible for when it was queried.

  2. Filter on History - Source = Saved Look or History - Source = Dashboard, and filter on Look - ID is null and Dashboard - ID is null (looks and dashboards that have been hard-deleted will no longer have their IDs show up in the internal db).

  3. Add fields from the Query view that will help identify the query that the look was using, such as Query - Model, Query - Explore, Query - Fields Used, or Query - Filters Used.

  4. Once you've identified the query you want, add the Query - Link field to your i__looker query. This should link you to the exact query that was used in the deleted Look, which you can now save to any folder you'd like.

If Query Link does not work, trying adding Query Slug instead. This will give you the share URL slug of this query. You can then access this query by navigating to:

 https://company.looker.com/x/QUERY_SLUG_HERE

If neither of those seem to work, you can use the fields from Step 4 that you used to identify the query to recreate it from its fields and filters.

Here's an example query with all of the relevant fields mentioned above: https://<your_domain_here>/explore/i__looker/history?fields=history.id,history.created_time,query.model,query.view,query.formatted_fields,query.formatted_filters,query.link,query.slug&f[look.id]=NULL&f[history.source]=Saved+Look%2CDashboard&f[history.real_dash_id]=NULL&sorts=history.created_time+desc&limit=500&query_timezone=America%2FNew_York&vis=%7B%7D&filter_config=%7B%22look.id%22%3A%5B%7B%22type%22%3A%22null%22%2C%22values%22%3A%5B%7B%22constant%22%3A%22%22%7D%2C%7B%7D%5D%2C%22id%22%3A0%2C%22error%22%3Afalse%7D%5D%2C%22history.source%22%3A%5B%7B%22type%22%3A%22is%22%2C%22values%22%3A%5B%7B%22constant%22%3A%22Saved+Look%22%7D%2C%7B%7D%5D%2C%22id%22%3A1%2C%22error%22%3Afalse%7D%2C%7B%22type%22%3A%22is%22%2C%22values%22%3A%5B%7B%22constant%22%3A%22Dashboard%22%7D%2C%7B%7D%5D%2C%22id%22%3A2%2C%22error%22%3Afalse%7D%5D%2C%22history.real_dash_id%22%3A%5B%7B%22type%22%3A%22null%22%2C%22values%22%3A%5B%7B%22constant%22%3A%22%22%7D%2C%7B%7D%5D%2C%22id%22%3A3%2C%22error%22%3Afalse%7D%5D%7D&dynamic_fields=%5B%5D&origin=share-expanded

Note: We CANNOT recover the look or dashboard using the look explore or the dashboard explore because the look and dashboard IDs are removed from the tables in the internal db once the content is hard-deleted (deleted from the Trash). Therefore, using the steps above to find when the content was queried is the only way to recover hard-deleted content.

 

This content is subject to limited support.                


2 replies

Hi,

 

I tried this out. As mentioned above, got one of my dashboard deleted accidentally and it got moved to trash. in such case when I followed the above steps, I can restore the looks one by one using the respective query link and then have to reconstruct the whole dashboard. But in case If trash has also lost the dashboard/look, the history explore doesn’t provide information about the looks (once I clear cache and refresh the history explore). This seems to be in contrast with the above description. 

 

Kindly react if the above statement is incorrectly processed by me!

Userlevel 5
Badge

Hi @Govardhan Balasundaram , I think that both your post and the original post are correct. 

The original post mentions that “We CANNOT recover the look or dashboard using the look explore or the dashboard explore because the look and dashboard IDs are removed from the tables”. I believe this is what you’re experiencing. This is also why, in step 3, the original post recommends filtering on the Look/dashboard ID being null.

 

Since the Look and dashboards IDs are null, it’s very tricky to pinpoint the Look. I’ll walk through an example with some screenshots.

 

First, let’s say I have a Look that has not been deleted from the trash. Its Look ID is 11552. As you mentioned, this shows up in the History explore when filtering the Look ID:

 

But then if I delete the Look from the trash, and clear cache and refresh, this same query returns nothing.

 

This is because the Look ID has been cleared from the internal database. However, we still have a chance to find this query, because the History record still exists. I narrow down my search using a more precise timestamp, the model name, and the explore name, and I am able to find those same history records as in the first screenshot, just with a null Look ID!

So the bottom line is that it is possible to find deleted Looks in the History explore, but you need to know a lot of other information about them. In this example, knowing a precise time that it was run, plus the model and explore, was enough info to pinpoint the deleted Look.

Reply