backup

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

  # Backup to S3
  weave backup create MyCollection --output backup.weavebak \
    --remote-storage s3 \
    --s3-bucket my-backups \
    --s3-region us-east-1

  # Backup to MinIO
  weave backup create MyCollection --output backup.weavebak \
    --remote-storage minio \
    --s3-bucket backups \
    --s3-endpoint localhost:9000 \
    --s3-no-ssl

  # Backup to S3 only (skip local file)
  weave backup create MyCollection --output backup.weavebak \
    --remote-storage s3 \
    --s3-bucket my-backups \
    --remote-only`,
	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

  # Restore from S3
  weave backup restore backup.weavebak \
    --remote-storage s3 \
    --s3-bucket my-backups \
    --s3-region us-east-1

  # Restore from MinIO and keep downloaded file
  weave backup restore backup.weavebak \
    --remote-storage minio \
    --s3-bucket backups \
    --s3-endpoint localhost:9000 \
    --s3-no-ssl \
    --keep-local`,
	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