Skip to content

Commit 0f4e887

Browse files
authored
Update export-backups-to-own-cloud-account.md
Added instructions for granular backups of specific tables and backing up all data
1 parent 51fc786 commit 0f4e887

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

docs/cloud/manage/backups/export-backups-to-own-cloud-account.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ You will need the following details to export/restore backups to your own CSP st
5757
2. Access HMAC key and HMAC secret.
5858
5959
<hr/>
60+
6061
# Backup / Restore
6162
6263
## Backup / Restore to AWS S3 Bucket {#backup--restore-to-aws-s3-bucket}
@@ -81,7 +82,7 @@ For example, if you are taking daily backups, you will need to use a new UUID ea
8182

8283
```sql
8384
BACKUP DATABASE test_backups
84-
TO S3('https://testchbackups.s3.amazonaws.com/backups/<uuid>', '<key id>', '<key secret>')
85+
TO S3('https://testchbackups.s3.amazonaws.com/backups/<uuid>/my_incremental', '<key id>', '<key secret>')
8586
SETTINGS base_backup = S3('https://testchbackups.s3.amazonaws.com/backups/<base-backup-uuid>', '<key id>', '<key secret>')
8687
```
8788

@@ -153,3 +154,38 @@ RESTORE DATABASE test_backups
153154
AS test_backups_restored_gcs
154155
FROM S3('https://storage.googleapis.com/test_gcs_backups/<uuid>', 'key', 'secret')
155156
```
157+
158+
# Granular Backups
159+
160+
The `BACKUP` command also works with granular backups of specific tables. Example AWS commands for backing up a specific table are listed below. GCP and Azure commands are similar to the ones explained above, except that they need to be customized to backup specific tables.
161+
162+
### Take a Granular Backup
163+
**Full Backup**
164+
```sql
165+
BACKUP TABLE data TO S3('https://testchbackups.s3.amazonaws.com/backups/<uuid>', '<key id>', '<key
166+
secret>')
167+
```
168+
169+
**Incremental Backup**
170+
```sql
171+
BACKUP TABLE data TO S3('https://testchbackups.s3.amazonaws.com/backups/my_incremental/', '<key id>', '<key
172+
secret>') SETTINGS base_backup = S3('https://testchbackups.s3.amazonaws.com/backups/<base-backup-uuid>', '<key id>', '<key
173+
secret>')
174+
```
175+
176+
### Restore from Granular Backup
177+
```sql
178+
RESTORE TABLE data AS data3 FROM
179+
S3('https://testchbackups.s3.amazonaws.com/backups/my_incremental', '<key id>', '<key secret>')
180+
```
181+
182+
### Backup and Restore all service data
183+
**Backup**
184+
```sql
185+
BACKUP TABLE system.settings_profiles, TABLE system.row_policies, TABLE system.quotas, TABLE system.functions, ALL EXCEPT DATABASES INFORMATION_SCHEMA,information_schema,system TO S3('https://testchbackups.s3.amazonaws.com/backups/', '<key id>', '<key secret>')
186+
```
187+
188+
**Restore**
189+
```sql
190+
RESTORE ALL FROM S3('https://testchbackups.s3.amazonaws.com/backups/', '<key id>', '<key secret>')
191+
```

0 commit comments

Comments
 (0)