The Big Query Backup Util
is a solution to create backup of Big Query Objects DDL of Views and Table Functions. Pulls the contents of CSV files exported from BQ, creating backup files in appropriate directories without overwriting.
- ๐ณ Docker
-
Clone the Repository ๐
git clone https://github.com/oseliocandido/big-query-backup-util.git && cd big-query-backup-util
-
Get CSV Files ๐
Place CSV files containing DDL statements in the
Input/Views
andInput/Table_Functions
directories accordingly. -
Start the Container
โถ๏ธ Run the container with your backup timestamp, overwriting the
BACKUP_DATE
environment variable.docker-compose run -e BACKUP_DATE=[YOUR_TIMESTAMP_HERE] gcp-backup-ddls
-
Confirm Operation โ
It will prompt for confirmation. Type
y
to proceed. -
Output ๐
Navigate to the
Output
directory where the backup files are saved.
- In the aux/ folder, there are the scripts to generate the CSV to be used. Replace the placeholders for actual Big Query
PROJECT
andDATASET
.