backup

package
v0.11.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackupCmd = &cobra.Command{
	Use:   "backup",
	Short: "Backup and restore vector database collections",
	Long: `Backup and restore vector database collections to portable .weavebak files.

Prevent data loss and eliminate costly re-ingestion with backup/restore commands.

Features:
  • Fast backup and restore (2,636 docs in < 2 minutes)
  • Compact files (~50-60MB compressed vs 733MB source)
  • Complete data preservation (embeddings + metadata + images)
  • Cross-VDB migration (export from one VDB, restore to another)

Example workflow:
  weave backup create MyCollection --output backup.weavebak
  weave backup validate backup.weavebak
  weave backup restore backup.weavebak
  weave backup list backups/

Use cases:
  • Before Docker/infrastructure changes
  • Regular snapshots via cron
  • Disaster recovery
  • Data migration between VDBs`,
	Example: `  # Backup a collection
  weave backup create AuctionImages --output backup.weavebak

  # Backup with compression (default)
  weave backup create AuctionImages --output backup.weavebak --compress

  # Restore from backup
  weave backup restore backup.weavebak

  # Restore to different collection
  weave backup restore backup.weavebak --collection NewName

  # Validate backup integrity
  weave backup validate backup.weavebak

  # List all backups in directory
  weave backup list backups/`,
}

BackupCmd represents the backup command

View Source
var CreateCmd = &cobra.Command{
	Use:   "create <collection> --output <file>",
	Short: "Backup a vector database collection",
	Long: `Export a vector database collection to a portable .weavebak file.

The backup includes:
  • All document embeddings (vectors)
  • All document content and metadata
  • Collection schema and configuration
  • Images (base64 and external URLs)

The backup file can be used to:
  • Restore the collection to the same VDB
  • Migrate to a different VDB type
  • Create snapshots for disaster recovery`,
	Example: `  # Backup collection to file
  weave backup create MyCollection --output backup.weavebak

  # Backup without compression
  weave backup create MyCollection --output backup.weavebak --no-compress

  # Backup with custom batch size
  weave backup create MyCollection --output backup.weavebak --batch-size 500

  # Backup specific VDB
  weave backup create MyCollection --vdb milvus-local --output backup.weavebak`,
	Args: cobra.ExactArgs(1),
	RunE: runBackupCreate,
}

CreateCmd represents the backup create command

View Source
var ListCmd = &cobra.Command{
	Use:   "list [directory]",
	Short: "List backup files in a directory",
	Long: `List all .weavebak backup files in a directory with metadata.

Displays information about each backup:
  • Filename
  • Collection name
  • Document count
  • File size
  • Creation date
  • Weave version
  • Compression status

Useful for:
  • Finding available backups
  • Checking backup metadata before restore
  • Inventory management`,
	Example: `  # List backups in current directory
  weave backup list

  # List backups in specific directory
  weave backup list backups/

  # List with JSON output
  weave backup list backups/ --json`,
	Args: cobra.MaximumNArgs(1),
	RunE: runBackupList,
}

ListCmd represents the backup list command

View Source
var RestoreCmd = &cobra.Command{
	Use:   "restore <backup-file> [flags]",
	Short: "Restore a collection from a backup file",
	Long: `Restore a vector database collection from a portable .weavebak file.

The restore command:
  • Reads backup file (auto-detects compression)
  • Validates backup format and version
  • Creates collection if it doesn't exist
  • Batch inserts all documents with progress tracking
  • Preserves embeddings, metadata, and images

Use cases:
  • Disaster recovery after data loss
  • Restore after infrastructure changes
  • Migrate data between VDB instances
  • Clone collections with new names`,
	Example: `  # Restore to original collection name
  weave backup restore backup.weavebak

  # Restore to different collection
  weave backup restore backup.weavebak --collection NewName

  # Overwrite existing collection
  weave backup restore backup.weavebak --overwrite

  # Restore to specific VDB
  weave backup restore backup.weavebak --vdb milvus-local

  # Quiet mode (no progress output)
  weave backup restore backup.weavebak --quiet`,
	Args: cobra.ExactArgs(1),
	RunE: runBackupRestore,
}

RestoreCmd represents the backup restore command

View Source
var ValidateCmd = &cobra.Command{
	Use:   "validate <backup-file>",
	Short: "Validate a backup file",
	Long: `Validate the integrity and structure of a backup file.

Checks performed:
  • File exists and is readable
  • Valid JSON format
  • Correct backup version
  • Collection metadata present
  • All documents have required fields (ID, embedding)
  • Embedding dimensions match metadata
  • No duplicate document IDs

Returns exit code:
  • 0: Backup is valid
  • 1: Backup has errors`,
	Example: `  # Validate a backup
  weave backup validate backup.weavebak

  # Validate with JSON output
  weave backup validate backup.weavebak --json

  # Validate compressed backup
  weave backup validate backup.weavebak.gz`,
	Args: cobra.ExactArgs(1),
	RunE: runBackupValidate,
}

ValidateCmd represents the backup validate command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL