Skip to main content

Unpack backup

This function reads a backup file (created from create backup) and stages it temporarily as the new database.

This is a temporary state for use as a preview of the backup file. For example, getting credentials while unpacked will get credentials from the backup database. Use finalize import to persist the changes, permanently replacing the old database with the backup database. Use rollback import to exit the temporary state of the unpacked backup, reverting back to the original database.

While in the temporary state of an unpacked backup an additional call to unpack the backup will fail. Termination of the app while in this temporary state produces the same result as rollback import.

Function

unpackBackup(
password: string,
inputPath: string
): Promise<ImportBackupMetadata>

Parameters

  • password - Value defined during creation of the backup.

  • inputPath - Path to the stored backup file.

Return value

export interface ImportBackupMetadata {
dbVersion: string;
dbHash: string;
createdAt: string;
}

Successful unpacking returns metadata of the backup file.