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
- React Native
- iOS
- Android
unpackBackup(
password: string,
inputPath: string
): Promise<ImportBackupMetadata>
func unpackBackup(password: String, inputPath: String) throws -> MetadataBindingDto
fun `unpackBackup`(`password`: String, `inputPath`: String): MetadataBindingDto
Parameters
-
password
- Value defined during creation of the backup. -
inputPath
- Path to the stored backup file.
Return value
- React Native
- iOS
- Android
export interface ImportBackupMetadata {
dbVersion: string;
dbHash: string;
createdAt: string;
}
public struct MetadataBindingDto {
public var dbVersion: String
public var dbHash: String
public var createdAt: String
}
data class MetadataBindingDto (
var `dbVersion`: String,
var `dbHash`: String,
var `createdAt`: String
)
Successful unpacking returns metadata of the backup file.