Restore a deleted BigQuery table from a snapshot using time travel.
Restores a deleted BigQuery table from a snapshot using BigQuery time travel.
The command will:
- Verify that the table is actually deleted
- Parse the provided timestamp into the correct format
- Use BigQuery's time travel feature to restore from the snapshot
- Create the recovered table with the specified name (or default to table_name_recovered)
Note: BigQuery time travel is limited to 7 days. You can only restore tables that were deleted within the past 7 days.
Timestamp formats supported:
- Epoch milliseconds (e.g., 1705315800000)
- ISO 8601 format (e.g., 2024-01-15T10:30:00)
- Date format (e.g., 2024-01-15 10:30:00)
table_id: Full table ID (project.dataset.table) of the deleted table to restoretimestamp: Snapshot timestamp as epoch milliseconds or date format (YYYY-MM-DD HH:MM:SS or YYYY-MM-DDTHH:MM:SS)
Full table ID for the recovered table. Defaults to original table name with '_recovered' suffix
Output more info about what is going on
Basic restore example with default recovered table name:
$ dbtwiz admin restore my-project.my_dataset.my_table 2024-01-15T10:30:00Restore with custom recovered table name:
$ dbtwiz admin restore my-project.my_dataset.my_table 1705315800000 --recovered-table my-project.my_dataset.my_table_backupRestore with epoch milliseconds:
$ dbtwiz admin restore my-project.my_dataset.my_table 1705315800000