I am trying backup and restore of a MS SQL server through VSS. My backup operation is running fine and I store the backup metadata in XML file. During restore operation I am providing the same XML I created during backup operation, what is happening is that restore is failing intermittently in PreRestore Stage returning VSS_E_OBJECT_NOT_FOUND. I have tried following things:
- Checked that if my VSS service is running correctly at the time of restore.
- Checked Microsoft Shadow Copy provider is running during restore.
- Checked if network services are running fine during restore.
- Checked on different forum what this error could be related to but most of the suggestion are like trying reboot the system.
The error comes on one of the following lines (intermittently), sometime it breaks at line1, sometime at line2 or sometime at line3, all these 3 api's I am calling before PreRestore event:
CHECK_COM(m_pVssObject->SetAdditionalRestores(myWriterId, VSS_CT_FILEGROUP, logicalPath, compName, true));
CHECK_COM(m_pVssObject->AddNewTarget(myWriterId, VSS_CT_FILEGROUP, logicalPath, compName, wszPath, wszFileNameMdf, false, wszAlternatePath));
CHECK_COM(m_pVssObject->AddNewTarget(myWriterId, VSS_CT_FILEGROUP, logicalPath, compName, wszPath, wszFileNameLdf, false, wszAlternatePath))
and this is the response it is returning.
INFO: VSS: ERROR: - Returned HRESULT = 0x80042308
INFO: VSS: ERROR: - Error text: VSS_E_OBJECT_NOT_FOUND