backupRestore

Restore a database from an incremental backup.

For an overview, see page Incremental Backup

Prototype

    void backupRestore(McoSql::String* file,
                McoSql::String* label,
                McoSql::String* cipherKey);

Arguments

file
The path and filename for the backup file
label
The backup record label to restore up to
cipherKey
A cipher to decrypt the backup

Description

This method restores a database from an incremental backup by calling the C API mco_backup_restore(). (Please refer to the mco_backup_restore() reference page for further details.)

Return Codes

Runtime Exception
In case of error, a runtime exception will be thrown with the appropriate error message.

Example

    {
        MCO_RET rc;
        mco_device_t       dev[4];
        McoSqlEngine engine;
        McoSqlOpenParameters params;
        char * backup_file = "SimpleDb_backup.dbs";
        char * label = "";

        ...
        rc = engine.open(params);
        if ( MCO_S_OK == rc )
        {
            rc = engine.backupRestore( backup_file, label, NULL);
            engine.close();
        }
        ...
    }