locked
How to use Volume Shadow Copy Service for backup program in C++ RRS feed

  • Question

  • Hi I would like to know how to set up Volume Shadow Copy Service properly to use in a file replicator / data backup program (specifically about context/state/writer communication). The program is a file replicator that needs to copy files from a source to a destination directory. Each replicator job after the initial just copies new / modified files. I'd like to use VSS to allow backup copying of files that are currently open and could change in the middle of the copy job for example an Outlook pst file. I found these three sources:

    https://wj32.org/wp/2012/12/13/how-to-backup-files-in-c-using-the-volume-shadow-copy-service-vss/

    http://www.codeproject.com/Articles/321273/VSS-API-IN-CPP

    Windows VSS (Volume Shadow Copy) in C++

    They are all similar but have subtle differences in their implementations which is why I am posting this here. I'd like to know how to properly set things up for my purposes. I also found the official Microsoft documentation here:

    https://msdn.microsoft.com/en-us/library/windows/desktop/aa384589(v=vs.85).aspx#

    So to get to the point - do I need to do SetContext and/or SetBackupState and if so what state/context do I need to specify? I'm just backing up entire folders and their contents for each backup job (these may contain open data files like Outlook pst files). Also I only back up new/modified files each time. And I'd like to do better than just a crash-consistent state - this requires writer communication right? Can I get a perfect copy of the target data by just calling AddToSnapshotSet for the folders to copy or do I need to do writer communcation with component selection? Anything else to know?

    Thanks for the help!

    Saturday, July 23, 2016 9:09 PM

Answers

  • Hi Crag_Hack,

    Sorry for my late reply.

    Have you read this document about Using the Volume Shadow Copy Service ? If not, you could refer to it for details.

    It would give you correct steps to use Volume Shadow Copy Service.

    Best Regards,

    Xavier Eoro


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 2, 2016 1:24 AM

All replies

  • Hi Crag_Hack,

    Sorry for my late reply.

    Have you read this document about Using the Volume Shadow Copy Service ? If not, you could refer to it for details.

    It would give you correct steps to use Volume Shadow Copy Service.

    Best Regards,

    Xavier Eoro


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 2, 2016 1:24 AM
  • Sorry for my late reply... :)  Yes I have read that doc.  However I felt it didn't address whether writer communication is required to make a perfect backup not just crash-consistent state.  And how to do writer communication.  The doc is a little convoluted.  As in my first post I'm wondering about backup state/context and making a spotless backup - whether this requires writer communication and if so how to do it.
    Friday, August 12, 2016 8:22 PM