VSS Snapshot Backup of SQL database from default instance and restored in named instance does not work

0

I have been trying a few experiments with VSS mainly related to backup and restore of SQL database across different scenarios.

The experiments that have succeeded so far are:

  1. Backed up the VSSTest Database from the default instance and were able to restore the database into the default instance of the same host and all data was successfully restored including transaction logs restore.
  2. We backed up the VSSTest Database from a named instance and were able to restore the database into the named instance of the same host and all data was successfully restored including transaction logs restore.
  3. Again similarly, backed up the VSSTest Database from the default instance and were able to restore the database into the default instance of another host and all data was successfully restored including transaction logs restore.

Continuing on the same route, I have been trying to perform the experiment in which I backup the database from default instance of one host and restore it to named instance of another host and it fails with this error.

2020/07/21 13:59:07 ERROR 32 (0x00000020) Copying File C:\user\VSS\VSSBackups\VSSTestDB1.mdf
The process cannot access the file because it is being used by another process.
Waiting 1 seconds... Retrying...
            Older                  8.0 m        VSSTestDB1.mdf
2020/07/21 13:59:08 ERROR 32 (0x00000020) Copying File C:\user\VSS\VSSBackups\VSSTestDB1.mdf
The process cannot access the file because it is being used by another process.
Waiting 1 seconds... Retrying...

The error is also the same if I backup database from default instance of one host and restore it to named instance of same host.

I want to ask now that is this a known issue with VSS or SQL server that we can't restore DB's from default instance to a named instance?

In case you want to enquire the steps that I have followed, please have a look below:

  1. Backup the volume using Vshadow executable and store the metadata in an xml file

.\vshadow.exe -p -bc=C:\user\VSS\backupComp22.xml C:\

  1. Mount the volume and copy the mdf and ldf files of test database to another folder.
  2. Perform some SQL transactions on the database and generate some transaction logs.
  3. Use vshadow again to restore by using the following command.

.\vshadow.exe -exec=vss-robocopy2.cmd -r=C:\user\VSS\backupComp22.xml

  1. Finally run SQL script to restore the transaction logs.
sql
sql-server
windows
backup
volume-shadow-service
asked on Stack Overflow Jul 21, 2020 by Rakshit Tiwari

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0