babylon.utils.backup

Backup and restore utilities for the Archive (ChromaDB).

Data preservation is a revolutionary act. The historical record must survive state repression.

Functions

backup_chroma([backup_dir, backup_name])

Create a backup of the ChromaDB data directory.

list_backups([backup_dir])

List all available ChromaDB backups.

restore_chroma(backup_path[, force])

Restore ChromaDB from a backup.

babylon.utils.backup.backup_chroma(backup_dir=None, backup_name=None)[source]

Create a backup of the ChromaDB data directory.

Parameters:
  • backup_dir (Path | None) – Directory to store backups. Defaults to ./backups

  • backup_name (str | None) – Name for the backup. Defaults to timestamp-based name.

Return type:

Path

Returns:

Path to the created backup directory

Raises:
babylon.utils.backup.restore_chroma(backup_path, force=False)[source]

Restore ChromaDB from a backup.

Parameters:
  • backup_path (Path) – Path to the backup directory

  • force (bool) – If True, overwrite existing ChromaDB data

Raises:
Return type:

None

babylon.utils.backup.list_backups(backup_dir=None)[source]

List all available ChromaDB backups.

Parameters:

backup_dir (Path | None) – Directory containing backups. Defaults to ./backups

Return type:

list[Path]

Returns:

List of backup directory paths, sorted by modification time (newest first)