none
How to determine whether a PST file has changed RRS feed

  • Question

  • I've written a simple Backup process that checks whether the date and size of a file have changed - if they have I copy the new version of the file to my Backup location.

    With my PST files, every time I open Outlook the file date is changed - even if I've made no changes to the emails in the PST file.

    So I fall back to testing whether the PST file size has changed - but the file size only changes when Outlook needs to increase the PST storage size. I can add and delete emails from the PST file and the file size stays the same.

    I've looked at the PST file layout and found the header CRC - but this also seems to change whenever I open Outlook even if I make no changes to the emails in the PST file.

    Is there anything I can test for in a PST file that tells me whether any emails have been added/deleted/removed from the PST file - so I can make a backup copy ?

    Monday, May 9, 2016 8:23 PM

Answers

All replies

  • Hello,

    You can compare backed up and working files on the byte-to-byte basis. Or just check the hash/checksum. See How to compare 2 files fast using .NET? for more information. 


    [custom.development]

    Monday, May 9, 2016 8:40 PM
  • I don't think there is anything you can do besides parsing the PST file.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, May 9, 2016 8:45 PM
  • Hi Orcop,

    I agree with Eugene and Dmitry, you could not compare pst file directly. Did the suggestion from Eugene work for you? For another way, I suggest you load the pst file into outlook at a time, and export them to csv file, then you could compare the exported csv files.

    Best Regards,

    Edward


    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, May 10, 2016 3:07 AM
  • I've tried using the "dwCRCPartial" CRC in the header - but this also changes every time Outlook opens the PST file even when no changes are made to the contents.

    The PST files I want to back up are large - typically between 500MB and 1GB, with the backup files on a remote file server. I was looking for a unique characteristic in the files that I can check to tell me whether the contents had changed. I thought the CRC would work but, as above, that appears to change when the file is opened in Outlook.

    I've looked at "dwCRCFull" but haven't tried using it as it looks to include the same data that "dwCRCPartial" - so will also change each time the file is PST opened ?

    Parsing the PST file and checking block CRCs is beyond me and the files are too large to compare byte by byte across my network.

    Is there anything else I can look at ?

    Many Thanks

    Tuesday, May 10, 2016 5:46 AM
  • Why not treat PST files as arrays of blocks of length 4kB or so? Calculate CRC's for each block and only copy those that changed.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, May 10, 2016 6:13 AM