View the original community article here
Last tested: Mar 25, 2019
Gazer is a command line tool for Looker content management. You can use it to overwrite existing content with new content so that the URL of the existing content does not change with the update.
How to do it
Set up:
- Old dashboard: ID=15, name=Old Dashboard
- New dashboard: ID=19, name=Renovated Dashboard
- instance = example.looker.com
Requirements:
- Both dashboards in the same space
Step by step
- Copy the content of the new dashboard into your current directory.
gzr dashboard cat 19 --host=example.looker.com --dir ~
- Then you can
ls
to see the new file: it should have the same name as it does in the instance (that's what "~" does), prepended with "Dashboard_[ID]_". Note that this example "Renovated Dashboard" has a space, which the terminal will store as "\ " in subsequent commands. - Open the new dashboard file in any text editor.
vi Dashboard_19_Renovated\ Dashboard.json
- Make 2 changes to the dashboard in the text editor.
- Remove the slug.
- It will look something like this:
"slug": "yBPjFba"
. Remove the entire line. - A 'slug' is a unique id for an object which is globally unique, not just an integer id which is only unique within its backend db table. Queries, looks, dashboards and other stuff now have slugs as well as integer ids.
- It will look something like this:
- Change the dashboard to match the old dashboard name being replaced. If the old name is not desirable, you can change it manually once you're done (either in the terminal or Looker UI).
- Remove the slug.
- Import the new dashboard from your machine to Looker. Specify the space and the host.
gzr dashboard import Dashboard_19_Renovated\ Dashboard\.json 445 --host=example.looker.com --force
That's it! Go back to the space and your new content should be over the old content URL. You can delete the new content where it originally existed before we copied it.
This content is subject to limited support.