Member-only story

Export BigQuery Saved Queries programmatically

Márton Kodok
4 min readJan 27, 2025

--

For data professionals working with Google BigQuery, saved queries are essential for streamlining analysis and sharing valuable insights. These queries, often complex and meticulously crafted, represent a significant investment of time and expertise. However, the question of how to effectively migrate or back them up can be a concern.

This article explores a practical approach using the Dataform API
to export your BigQuery saved queries.

Export BigQuery Saved Queries programmatically

Migrating Your Classic Saved Queries to BigQuery Studio

BigQuery is allowing users to migrate their classic saved queries to the new BigQuery Studio format backed by Dataform. This process is done on the UI, in batches and has some important considerations. Here’s what you need to know.

NEW Saved Queries

Once completed Saved queries are BigQuery Studio code assets powered by Dataform, and its accesible by API.

The Challenge: Migration and Backup

While BigQuery provides a user interface to work with saved queries, the need to programmatically extract them for migration to a different environment or simply to have a robust backup is paramount. Unfortunately, BigQuery doesn’t directly provide a straightforward…

--

--

Márton Kodok
Márton Kodok

Written by Márton Kodok

Speaker at conferences, a Google Developer Expert top user on Stackoverflow, software architect at REEA.net, co-founder IT Mures, life-long learner, mentor

Responses (1)