SQL VSS Writer, copy-only backups

Posted on 2014-10-15
Last Modified: 2014-11-12
I am backing up a SQL database, in SQL 2014 (though if you know the answer pertaining to older versions of SQL, I'd be interested in hearing it), using a 3rd party product. This product utilizes the SQL VSS Writer to perform the backup. I have edited the registry, by creating the following key, with a value of 1.


This keeps the backup from truncating the logs. The question is, is there a setting that I can add that will cause all of the backups using the SQL Writer to do a copy-only backup?

The reason for this, I am doing snapshots of the database in AWS using a product called CPM. It just creates AWS snapshots, and is a management layer on top. I don't want these backups to register within SQL itself, so that I can perform a second backup from within SQL itself, as well as log backups with truncation. By setting the registry value above, my snapshots do not truncate the logs anymore, but each snapshot shows up as a full backup within SQL. If I can set the backups going through the SQL writer to be copy-only, then they will not show up as a full backup in SQL. And at that point, I can do a separate full backup within SQL itself that doesn't user the writer and subsequent log backups that provide more granular point-in-time recoveries that I can't get with the snapshots.
Question by:PMFM
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 20

Expert Comment

by:Marten Rune
ID: 40384450
Here is the Microsoft link to the writer. Though I thing the 3'rd party Product needs to have this function implemented. It clearly states that the writer supports copy_only backups. But it needs to be requested from the requestor, i e the 3'rd party backup program.

I did google the CPM, but with no luck. So I don't Think I can help further.

You need to find documentation from the CPM, or ask their support if this function is implemented.

Regards Marten
LVL 40

Expert Comment

ID: 40384481
At the link below it is stated that indeed "SQL Writer supports: Copy-only backup"

"The backup type (full, copy, incremental) can be specified by a VSS-based backup application at the beginning of the backup session, using the IVssBackupComponents::SetBackupState."

For older versions the link below explains how to "Copy-Only Backup.  It is sometimes necessary to take a backup that is intended for a special purpose, for example when you need to make a copy of a database for testing purposes.  This backup should not impact the overall backup and restore procedures for the database. Using the COPY_ONLY option specifies that the backup is done “out-of-band” and should not affect the normal sequence of backups. The SQL writer supports the “copy-only” backup type with SQL Server 2005 instances."

Basicaly "SQL Writer Metadata Document"  which is "an XML document created by a writer (the SQL writer in this case) using the IVssCreateWriterMetadata interface, and containing information about the writer's state and components." where "◦VSS_BS_COPY – supports “copy-only” backup option."  Support

Author Comment

ID: 40384506
Thanks. I had found in the documentation that it supports it. As well as disabling truncation. What I can't find documented is a way to change the settings on the VSS writer itself. The CPM backup software support suggested a registry key to disable truncation for any backups that use the SQL Writer, whether CPM or another product. That worked perfectly, though I can't find it documented any place else. I was hoping to find the same type of solution for copy-only. The interface and options for the use of VSS in CPM is limited. So, my only chance at getting this will be through a configuration file or registry edit.
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

LVL 40

Expert Comment

ID: 40384536
That's exactly what the XML "SQL Writer Metadata Document" will do for you - right?

Basicaly "SQL Writer Metadata Document"  which is "an XML document created by a writer (the SQL writer in this case) using the IVssCreateWriterMetadata interface, and containing information about the writer's state and components." where "◦VSS_BS_COPY – supports “copy-only” backup option."  Support

Author Comment

ID: 40384665
Right, but I can't find the location of this .xml file, and it sounds like it is possibly generated on the fly by the writer itself and any changes to parameters would have to be done when calling the sql writer. That may be completely incorrect - it's really just a semi-educated guess. The .xml file is not in the same location as the sqlwriter executable or any of the subfolders.
LVL 40

Expert Comment

ID: 40384721
You can do it via "IVssCreateWriterMetadata interface"
LVL 40

Accepted Solution

lcohan earned 500 total points
ID: 40384749
in 2014 you can do it via the "IVssBackupComponents interface"
"Applications obtain an instance of the IVssBackupComponents interface by calling CreateVssBackupComponents."

you need to set
IVssBackupComponents::SetBackupState VSS_BACKUP_TYPE backupType as VSS_BT_COPY   = 5 - see links below for details:

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question