Part 1 - The BasicsPart 2 - The Basics continuedPart 3 - ConfigurationPart 4 - CommunicationPart 5 - Quick DeploymentPart 6 - LoggingPart 7 - Change Token BasicsPart 8 - Job and Change TokenPart 9 - Job and Timerjob
Incremental deployment allows to deploy all content changes in the source database since the last successful deployment which are in the configured scope of the content deployment job.
To implement this functionality content deployment makes use of so called "change tokens".
A very common issue with content deployment is that incremental content deployment fails with the following error message:
The changeToken refers to a time before the start of the current change log
But what does this actually mean?
What we have seen in the earlier article series about the content deployment and migration API to perform an incremental deployment we have to pass in a change token that will be used as a reference to identify which objects need to be exported.
Using a change token, an application can determine "what content has changed" within a given scope since the change token has been generated.
To do this the information included in the change token is compared against Change log.
The Change log is stored in the EventCache table of the content database. This table stores the information about all content changes in the content database. Each entry in the Change log contains among other things the following information:
The following article contains some more details about these entries:http://msdn.microsoft.com/en-us/library/bb861918.aspx
The change log stores information for a timeframe that can be configured in the Web application general settings:
Each time the change log is queried for changes, it returns the changes together with a Change Token which corresponds to a database entry up to which the querying application has been synchronized. This change token is of the format Int1; Int2; Guid; Time; Int3.
The following scopes are possible for a change token:
Change Token Scope
When it comes to troubleshooting change token problems, it is also important to be able to analyze the change token itself – e.g. to see the date/time of the change it represents.
The following method allows to decrypt the change token into a better readable format:
This code will create output like the following:
The Change log can be queried for changes at four different scopes: Content Database, site collection, site or list scope. Depending on the application and what scope the application is interested in defines which scope needs to be used. For example, if an application is only interested in changes in a specific list, it can query for changes at the list scope. On the other hand, if changes across the entire database need to be monitored, then the change log can be queried at the content database scope.
The GetChanges method can be used to query for changes:
When you have a SPChangeCollection you can evaluate each change individually. Each SPChange object exposes the properties:
You can cast the individual SPChange objects to the exact change to get further information. For example, SPChangeWeb exposes the ID of the changed site. SPChangeFolder exposes the unique ID of the folder and the unique id of the site.
I have been investigating the Change Logs in one of our Content Database due to performance problem. Regarding the "ChangeType", I did check all the ChangeType you point in this blog, but I need to map the EventType Database Value with the ChangeType Enumeration value. Most of the values I can find in the Internet for Add, Delete, Update, etc. But when I querry the Content DB in the EventCache table, (I don't work directly in the Content DB, just a copy of the Backup Database), I have a EventType "134217728", which I cannot find the enumeration mapping anywhere, could you please help me to find an exhaustive mapping between the Database EventType Value (from the EventCache) table, and the ChangeType enumeration?
Thank you in advance for your help.
Here is the mapping:
Event Type Int Value (dec)
Move Into 65536
Thanks for your quick reply; it helps us to interpret the peaks of our curve from the EventCache data. Strangely, during the last 3 months, now and then we have performance issues in our publishing site, each time the problem is related with SQL Server, and the work around consists of watching closely the CPU usage of the SQL Server, when it is too high, we run a SQL job that recalculate the statistic which helps SQL to optimize the use of caching, and this solve the performance issue. We apply this work-around, but still cannot understand what cause the performance issue, and why rerun the statistic optimization job in SQL helps to solve the problem. I am analyzing the EventCache table to find a correlation, and all peaks correspond with "Navigation" events, and those peaks matched with the periods where the performance issues happened. First I guess that when the content manager delete lots of sub sites in the content, the performances issues occur. (This is a direct editing publishing site, because the staging, and production environments strategies cannot survive due to content deployment problems together with variations :-)
Now according to your mapping above, the peaks are really "Navigation" events and not "Delete" events. At this point, I get lost, and don't know what can cause the update of "navigation" to create such peaks recorded in the EventCache?
Have you ever run into such a case? With your experiences, I would hope you can enlighten us, because we are really sinking in the darkness with this recurrent performance issues.
Thank you so much for your time, and for sharing many precious information.
unfortuntelly I haven't looked into the details why Navigation events would be created as I never had a need to look into this. I would need to do some research on this topic. Best would be to open a support case with Microsoft to get this analyzed.
I want to extract values from SP Change Log for audit purpose. I can easily get the changed values but didn't find any way where I can get the 'Before Change' value. Can you pls throw some light on this approach..Pls also let me know if considering SP Change log for auditing purpose is correct approach.