Table of Contents

Class BackupOperations

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Backups without an engine: what typhon backup … and the Workbench share (D10), the way DatabaseRepair serves typhon repair. Online capture of a running database is the engine's (its backup coordinator); this facade backs up a closed one, and restores, verifies and lists a store.

public static class BackupOperations
Inheritance
BackupOperations
Inherited Members

Remarks

A store is a directory bound to one database: store.json, packs/ of immutable .tpack files, a rebuildable catalog.json. Every pack byte is under a CRC (BKP-08); a restore opens through the engine's crash path to exactly its point's committed state (BKP-05).

Methods

Create(string, string, BackupCreateOptions)

Backs up a closed database into a store (created when absent): a full point, or an incremental one when the database's last clean close kept a lineage this store's chain head continues.

public static BackupPointSummary Create(string bundle, string store, BackupCreateOptions options = null)

Parameters

bundle string

The database's {name}.typhon directory.

store string

The store directory.

options BackupCreateOptions

Full, WAL directory, cancellation, logging.

Returns

BackupPointSummary

The published point.

Exceptions

DatabaseLockedException

A process holds the database (online capture is the engine's).

StorageException

The bundle cannot be backed up as configured (e.g. an unclean database whose WAL is elsewhere).

BackupStoreLockedException

Another writer holds the store.

BackupStoreMismatchException

The store belongs to another database.

List(string, bool)

What the store holds, from its catalog (rebuilt in memory when stale).

public static BackupStoreListing List(string store, bool computeRestorable = false)

Parameters

store string

The store directory.

computeRestorable bool

Also run a quick verify and list the restorable points.

Returns

BackupStoreListing

Restore(string, PointSelector, string, BackupRestoreOptions)

Restores a point into a bundle: target is a {name}.typhon path carrying the database's own name, or a directory to put it in. Nothing is written before every refusal is checked; an existing bundle is moved aside, never deleted.

public static BackupRestoreResult Restore(string store, PointSelector point, string target, BackupRestoreOptions options = null)

Parameters

store string

The store directory.

point PointSelector

Which point.

target string

The bundle path or its parent directory.

options BackupRestoreOptions

Replace, format mismatch, forensics, settle, progress.

Returns

BackupRestoreResult

What was restored, and where.

Exceptions

RestoreRefusedException

The target exists, is live, is misnamed, or the image is of another format revision.

BackupChainBrokenException

A pack of the point's chain is missing or inconsistent; the message names what is restorable.

BackupPackCorruptException

A byte the restore needs failed its check.

Status(string)

The store's health from its packs' headers and footers and the chains they form: typhon backup status --store's answer and exit code. Cheap by design (each pack's header and footer, no index, no tail); Verify(string, BackupVerifyLevel) reads the rest.

public static BackupStoreStatus Status(string store)

Parameters

store string

The store directory.

Returns

BackupStoreStatus

Verify(string, BackupVerifyLevel)

Verifies the whole store. Never throws for damage: it reports it.

public static BackupVerifyReport Verify(string store, BackupVerifyLevel level)

Parameters

store string

The store directory.

level BackupVerifyLevel

Quick or full.

Returns

BackupVerifyReport

Exceptions

DirectoryNotFoundException

The directory is not a store.

BackupFormatUnsupportedException

The store was written by a newer format.

Verify(string, PointSelector, BackupVerifyLevel)

Verifies one point: the packs of its chain, and whether it is restorable. Never throws for damage.

public static BackupVerifyReport Verify(string store, PointSelector point, BackupVerifyLevel level)

Parameters

store string

The store directory.

point PointSelector

Which point.

level BackupVerifyLevel

Quick or full.

Returns

BackupVerifyReport