Skip to content

Add article: BACKUP to S3 without credentials in SQL - #195

Open
shanurwan wants to merge 1 commit into
Altinity:mainfrom
shanurwan:kb-backup-s3-without-credentials
Open

shanurwan wants to merge 1 commit into
Altinity:mainfrom
shanurwan:kb-backup-s3-without-credentials

Conversation

@shanurwan

Copy link
Copy Markdown

The KB covers clickhouse-backup but has no page on native BACKUP/RESTORE to S3. This adds one on keeping the S3 keys out of the statements (named collection or backup disk, both with from_env) and on the grants a dedicated backup user needs, which changed in 25.8 and again in 26.8 LTS.

Tested (Docker, S3-compatible store), every SQL and XML block copied from the article:

  • named collection: full + incremental backup and restore, 1,500 rows, count() and sum(cityHash64(*)) equal to the source: 24.8.14, 26.10.4; also 25.3.14, 25.8.33, Altinity Stable 25.3.14.10003 (from_env)
  • backup disk: backup + restore on 24.8.14, 25.3.14, 25.8.33, 26.10.4
  • grants, user with only BACKUP, SELECT ON db.*:
    • 25.3.14, 25.4.13, 25.5.11, 25.6.13, 25.7.8: both destinations work with no extra grant
    • 25.8.33, 26.3.65: named collection needs NAMED COLLECTION ON <name>; Disk() needs nothing more
    • 26.8.38, 26.10.4: additionally WRITE ON S3 / WRITE ON DISK; restore needs READ ON S3
  • system.named_collections shows [HIDDEN] for all values on every version above

The 25.8 boundary for NAMED COLLECTION ON <name> comes from these tests; I did not find the changelog entry for it, so a pointer is welcome.

Sources: #94605 (SQL-defined named collections in BACKUP/RESTORE, 26.1 + backports), #114405 (SOURCES grants for backup locations, 26.8), #117406 (Disk() authorization, READ/WRITE ON DISK).

I have read the CLA Document and I hereby sign the CLA

Named collection or backup disk with from_env, so BACKUP/RESTORE statements
carry no S3 keys, and the grants a dedicated backup user needs: NAMED
COLLECTION from 25.8, WRITE/READ ON S3 or ON DISK from 26.8.
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@shanurwan

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Nov 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant