I need to programmatically only change the ETag version of an SPFile (ideally to increment it only by one).
The situation is the following. I use the SPExport and SPImport to modify the file but I only want to change the content of the SPFile and not the last author, or the last modified TD... the only way of doing this is to use the SPExport, then to modify the exported file and then to call SPImport and this does the trick.
Now there is a problem with files in SkyDrive in SP2013: The little program (groove.exe) that synchronizes a library with the local folder does not get aware of the fact that the file content changed after having done an SPImport. Inspecting it in deep I see that this is because the ETag property of the file does not change.
Of course as far as I know, this property changes when doing an SPFile.SaveBinary (not even if you change a property of the List item!). But doing SaveBinary is not a choice since it would increment versioning and change the last modified TD and user.
As a consequence, the file is not resynchronized and the file size does not change. The local file is different than the one stored in the server.
I played doing SQL updates (I know this is not allowed but I do it manually only for testing purposes) and I change the InternalVersion field like:
UPDATE AllDocs set InternalVersion=513 WHERE LeafName='file.docx';
And this changes the ETag (since in SQL it is a computed column) and the file is well resync (only if you do not do a sync before executing the UPDATE statement)
Doing this programmatically is of course not a choice since it would break the support (it is not allowed). Is there a way to change the ETag property without changing other things?
BTW, there is a bug where if you add a .docx file (maybe with other files too) by copying this file to the local folder then when groove.exe sends this file to the server, in the server the last modified TD is the TD of the upload and locally it is the TD of the file... later if you modify the file in the server then when synchronizing it it is fixed.
Thanks