Skip to content

feat(backup): support incremental backups via baseBackupId - #473

Closed
gkampitakis wants to merge 1 commit into
weaviate:mainfrom
gkampitakis:feature/incremental-backups
Closed

gkampitakis wants to merge 1 commit into
weaviate:mainfrom
gkampitakis:feature/incremental-backups

Conversation

@gkampitakis

Copy link
Copy Markdown
Member

What

Weaviate accepts incremental_base_backup_id on POST /v1/backups/{backend} to build a file-based incremental backup on top of an existing one (added in weaviate#10275, released in 1.34.18 / 1.35.13 / 1.36.3 / 1.37.0). The client had no way to set it, and dropped the field from list/status responses, so incremental backups were unreachable from TypeScript.

This mirrors the Go v6 client, which exposes it as a top-level CreateOptions.BaseBackupID (not nested under config) and surfaces Info.BaseBackupID on returned backups.

Changes

  • client.backup.create and collection.backup.create accept an optional baseBackupId, via the new BackupCreateArgs / BackupCollectionCreateArgs types. Restore args are untouched — the field is create-only, as in Go.
  • BackupCreator.withBaseBackupId() puts it on the request as incremental_base_backup_id.
  • BackupStatusReturn gains baseBackupId; getCreateStatus and list map incremental_base_backup_id onto it.

All additive — no existing signature changes meaning, and BackupCreateArgs is a superset of BackupArgs<BackupConfigCreate>.

Notes

  • Weaviate only returns incremental_base_backup_id to callers it has confirmed as root users, so baseBackupId is often absent on reads even when the backup is incremental. Documented on the type.
  • The server validates the base: it must exist, be SUCCESS, be strictly older, share the same compression type, and the whole ancestor chain is walked for cycles. No client-side duplication of that.

Testing

  • test/collections/backup/mock.test.ts: asserts the create request carries incremental_base_backup_id (and omits it for a full backup), and that status/list responses map it to baseBackupId.
  • test/collections/backup/integration.test.ts: full backup → insert more data → incremental backup on that base → restore → assert both objects are present. Also asserts an unknown base is rejected. Gated with requireAtLeast(1, 34, 18).

Verified locally against Weaviate 1.36.10: all backup mock + integration tests pass. npm run lint, npm run format:check and npm run docs are clean (no new warnings).

🤖 Generated with Claude Code

https://claude.ai/code/session_01NZ2p2CzXLS92ThnvDjnxAE

@orca-security-eu orca-security-eu Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Weaviate 1.34.18/1.35.13/1.36.3/1.37.0 accept `incremental_base_backup_id`
on `POST /v1/backups/{backend}` to build a file-based incremental backup on
top of an existing one, but the client had no way to set it and dropped the
field from list/status responses.

Mirrors the Go v6 client, which exposes `CreateOptions.BaseBackupID` as a
top-level create option and `Info.BaseBackupID` on returned backups.

- `backup.create` and `collection.backup.create` accept `baseBackupId`
- `BackupCreator.withBaseBackupId` sends `incremental_base_backup_id`
- `getCreateStatus` and `list` map `incremental_base_backup_id` to
  `baseBackupId` on the return type

Weaviate only returns the base backup ID to root users, so `baseBackupId`
is often absent on reads even when the backup is incremental.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZ2p2CzXLS92ThnvDjnxAE
@gkampitakis
gkampitakis force-pushed the feature/incremental-backups branch from eb71991 to cb75e66 Compare September 2, 2026 12:28
@bevzzz

bevzzz commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

@gkampitakis I think this is a duplicate of #459

@gkampitakis

Copy link
Copy Markdown
Member Author

@gkampitakis I think this is a duplicate of #459

🙈 Should have checked first, sorry @bevzzz . Closing it over #459

@gkampitakis gkampitakis closed this Sep 2, 2026
@gkampitakis
gkampitakis deleted the feature/incremental-backups branch September 2, 2026 12:34
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.

2 participants