Microsoft SQL Database backup can result in old data being backed up!

Simple:
If you have both the “Microsoft SQL Databases” ticked and your backup set encompasses your SQL Data directory on the drive as well - you may not be backing up the latest database and could be in for a shock when you restore!

Version 2.0.4.5 (or higher?) you will see warning messages like “Failed while attempting to add unmodified file to database” referencing your database mdf and ldf files if you are affected by this. If you are on older versions they backup old data silently!

Detailed:
See this article:

Can anyone confirm or perform the same steps and verify?
Can this be fixed at a duplicati code level?

To fix this u need to enable the option some thing like ignore file timestamp under advanced options

The timestamp of mssql databases change only when the database files are closed.
Duplicati by default checks the timestamp and backs up only if the timestamp has changed.

This is not a bug

U should also add snapshot policy to required

Interesting one - I didn’t think or know about the timestamp option, I will change that and see what happens and re-test if the stale backup files problem exists.
The snapshot policy is already set to required.
Thank you for your input.

Just my two cents on database backup although it doesn’t directly address what you’re asking:

if you want to back up a database you must create a database dump and back that dump up.

Any other backup strategy is just gambling that Duplicati is lucky and doesn’t back up the database in a corrupted state.

If you do make dumps you’re also not risking the above issue as the timestamp will be correct for the time it was created regardless of when the database connection was closed.

2 Likes

What is the “Microsoft SQL Databases” section at the top of the sources list for ? (Only appears if you have SQL server and working SQL VSS writer).