How to make "SQL Server VSS Writer" make copy-only backups via Duplicati?


I had the issue described here. Instead of stopping the writer service (as suggested by the topic) I found that I can configure the writer by adding it’s id to the vss-exclude-writers parameter of Duplicati. So the issue is basically solved for me by that.

But while investigating the issue I also found, that the SQL Server VSS Writer could somehow be told to take copy-only backups. See here. Copy-only backups would not break existing backup chains. I guess Duplicati would have to pass VSS_BT_COPY to the VSS_BACKUP_TYPE parameter of the writer, right? If so, wouldn’t this be a meaningful parameter to add to Duplicati? DB backups could then be taken by Duplicati without inferring with other tools taking full-diff-log backups of the DBs …

1 Like

Welcome to the forum Tobias!

I do like your suggestion, I can see this being handy. Especially because in some cases someone may want to “test” Duplicate. Since it is not yet considered out of beta, I can also understand that some users may need to run it alongside other backup solutions, to prove its stability (or get comfort). And by having this option you essentially allow this to be possible.

In my case I have a special setup where I have a SQL and batch script that makes local backups of SQL server DBs and leave them on the server (for quick restores when needed). But then it also have to send the backups to a remote location (this code is less robust than I would like).

I was thinking of having Duplicati make daily backups of my DBs to a remote location (using it’s built in deduplication code) while my back script continues to make the local backups in Full-Diff-Log style. But since I can only have one SQL VSS backup running, I can’t have both running.

That would be my suggestion - use a database maintenance plan to create dumps, and then use Duplicati to back up those dumps. If Duplicati’s native SQL backup is anything like its native Hyper-V support, it is pretty rudimentary. I think all it does is use SQL VSS to find the names of the mdf/ldf files, creates a filesystem snapshot, and backs up those files raw.

Thank you for your responses, bernarddt and drwtsn32!

Unfortunately I don’t have time to implement this feature and provide a pull request to the project myself right now. If anybody else would like to do this, I can offer to review the code and give feedback.

Btw: I also don’t know in detail how Duplicati performs SQL Server database backups. I raised this issue about this, but didn’t get any response. Can anybody say (or document) more about this topic?

I think @mnaiman worked on it some, so could potentially help you and the manual author know it better.
If it requires going back to the original Duplicati author for information, it’s unlikely, but you can use GitHub.

The manual is a completely separate (but valuable) project, so issues there are less visible to developers.
There is also the constant challenge of very few volunteers in all areas. Thanks for your interest in helping.