I’ve tried to restore a MS SQL backup to a new computer.
Usually it works but sometimes MS SQL raises an error.
The MS SQL error is
The log scan number (198:31406:26) passed to log scan in database ‘FPS_4P’ is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
If you mean replica snapshots I’m not making any snapshot. I’m running the backup with the option snapshot-policy Required (as I found somewhere in the forum).
For the restore I used Duplicati (so I think same mdf and ldf version). I just attached the files to SQL Server.
The database was in use during backup (I could restore some other databases that I did not use during backup).
Is it possible that in some circumnsances, if the database is in use, the backup is not correct because of the way that Duplicati makes SQL Backups?
Note: I’m doing some disaster recovery tests just to understand how to recover from Duplicati (and to test Duplicati features)
Ok, that should flush the database to disk prior to making the snapshot.
Yes, that is very much possible. Duplicati does not specifically back up MSSQL databases, instead it relies on the VSS feature that makes is integrated with the MSSQL database.
It works the way that prior to making a disk snapshot, Duplicati will signal all VSS writers that a snapshot is pending. The VSS writers (including MSSQL) will then flush their contents to disk, and “pause” until the snapshot is made.
This should always create a safe copy of the database that can be backed up and restored. But it is possible that the VSS writer registration is somehow not working as expected on your system.
Do you see the databases when you browser for sources?
I see the database in original server and the database works fine.
I’m starting to think that doing SQL Server backups in this way is not safe (at least in some circumstances).
Actually I’m doing backups running T-SQL query then I backup the .bak files using Duplicati.
Probably also Duplicati should do SQL backups in this [more standard] way.