Symptoms

During the DS-Client db recovery in case of DR, DS-User > Setup > System Activities > Repair > Repair dsclient & dsdelta failed with below errors:

a) "Changed database context to 'master'. Changed database context to 'master'. Exclusive access could not be obtained because the database is in use. RESTORE DATABASE is terminating abnormally. Exclusive access could not be obtained because the database is in use. RESTORE DATABASE is terminating abnormally."
b)" Failed to recover DS-Client database. %1"
c) "No database object"

Cause

a. If a DS-Client computer crashed and the DS-Client application is installed on a new computer, very likely the SQL Server path will be different, as a result the DS-Client database recovery may fail (if SQL Server is v2012 or higher).
If the SQL Server service account does not have permissions to write the dump files on either path mentioned above the error "cannot open backup device" is reported.
b. Daily Admin process cannot perform a differential backup for a database that does not exist.
c. The error points to the database path of x86 which means the original SQL server was 32bit and the new SQL is 64bit.

Workaround

Step 1.  Install new SQL and new DS-Client on the new machine (same DS-Client number and encryption keys as the old one).

Step 2.  Run the 'Repair dsclient & dsdelta' process, which will download the dump files to the DS-Client buffer. From there copy the dump files for 'dsclient.dmp', 'dsclient_diff.dmp', 'dsdelta.dmp' and 'dsdelta_diff.dmp' (also all the expanddb.dmp if exist) to the intended location (C:\Program Files\Microsoft SQL Server\MSSQL version\MSSQL\DATA), Use the below steps to restore using SQL Management Studio on to a new SQL instance.

         1. Stop the dsclient service .
             Connect to the SQL management studio, First Create the dsclient and dsdelta database on the new SQL instance where you need the restore.

         2. To restore dsclient Database:
               a. Right click on the Database and select Restore Database.

               b. For destination, Under To database-choose dsclient. For the Source- From Device - navigate to the dmp location and choose dsclient.dmp.

                         Under Options page, for restore options choose "Overwrite the existing database (WITH REPLACE)" and for Recovery state choose "RESTORE WITH NONRECOVERY" then Select OK.

             The above step leaves the dsclient db in "restoring state", now restore the dsclient_diff.dmp file like above.

              c.  For destination, Under To database-choose dsclient. For the Source- From Device - navigate to the dmp location and choose dsclient_diff.dmp.

                        Under Options for recovery state, choose ONLY the option1 "RESTORE WITH RECOVERY", Select OK.

            The above step completes the dsclient restore. Follow the same procedure to restore the dsdelta.dmp and then dsdelta_diff.dmp files.
         3. Restore dsdelta full dump (choosing option Recovery state :RESTORE WITH NONRECOVERY) and then restore dsdelta differentialdump.

         4. Restore all the expand dbs.

Step 3. Start the ds-client service.