Start the asynchronous restore process.
MCO_RET mco_async_restore_start(
/*IN*/ mco_db_h connection,
/*IN*/ const char *file_name,
/*IN*/ const char *label,
/*IN*/ const char *cipher
);
connection
file_name
label
cipher
NULL for unencrypted backups.This function initiates a background task that restores the database from the specified backup file and label. The restore operation runs in a separate thread and establishes its own internal database connection (which does not include a sniffer context).
Only one asynchronous backup or restore operation can be active per database at a time.
See Incremental Backup and Restore for more details.
MCO_S_OK
MCO_E_BACKUP
MCO_E_ILLEGAL_PARAM
NULL file name, missing label, etc.).MCO_ERR_DB_NOMEM_HEAP
{
const char *db_name = "myDb";
mco_db_h con;
MCO_RET rc;
rc = mco_db_connect(db_name, &con);
if (rc != MCO_S_OK) {
/* handle connection error */
}
rc = mco_async_restore_start(
con,
"file.backup",
"v1.2", // restore up to this label
NULL // no encryption
);
if (rc != MCO_S_OK) {
/* handle restore start error */
}
}