The .sdo file does not contain all the approved postings in MCMS 2002 (900735)



The information in this article applies to:

  • Microsoft Content Management Server 2002


SYMPTOMS

When you perform a Site Deployment export in Microsoft Content Management Server (MCMS) 2002, the Site Deployment Object (.sdo) file does not contain all the approved postings.

Note This problem is more likely to occur when the export is large and takes several minutes to be completed.

CAUSE

This problem occurs when the postings are approved after Site Deployment starts the export process. If the postings are approved after the export process starts and before the export process ends, the timestamp that is recorded on the approved posting is incorrect. Therefore, when you perform the next export process, the approved posting is not picked up.

WORKAROUND

To work around this problem, you can use a script to export the content by using the COM-based Site Deployment API CmsDeployExport.Export method. The CmsDeployExport.Export method has a parameter named TimeInterval that you can use to specify the number of minutes that have elapsed since the last Site Deployment export was completed. To export the content by using a script, follow these steps:
  1. Create a timestamp file that has the last successful export time. For example, in the following code sample, the startTime variable is the time of the last successful export.
  2. Save the current time in a variable. For example, in the following code sample, the endTime variable is the current time.
  3. Determine the difference between the two variables, and then save the value in a variable. For example, in the following code sample, the elapsedTimeInMinutes variable is the difference between the startTime variable and the endTime variable.
  4. Start a Site Deployment export by using the elapsedTimeInMinutes variable.
  5. When the export is completed successfully, save the endTime variable in the timestamp file for the next export.
You can script the Site Deployment export process by using a script that is similar to the following:
'Filename: ExportSDO.vbs

'File System Object variables
Dim fso, file
Dim ForReading, ForWriting, ForAppending

'CMS Deployment objects
Dim pCmsDeployExport
Dim pExportOptions

'User variables
Dim pathname, timestampFileName, sdoFileName
Dim startTime
Dim endTime
Dim elapsedTimeInMinutes
Dim shell, strURLReport

On Error Resume Next

'Set the user variables
pathname = "C:\SDO"
timestampFileName = "sdoTimestamp.txt"

'Set the FSO variables
Set fso = CreateObject("Scripting.FileSystemObject")
ForReading = 1
ForWriting = 2
ForAppending = 8

'Open the file and obtain the last time of export
'The first line of the file has the last time of export
'For example: 5/1/2005 10:00:00 AM
Set file = fso.OpenTextFile(pathname & "\" & timestampFileName, ForReading)
startTime = file.ReadLine
file.Close

'Create a CMSDeployExport object
Set pCmsDeployExport = WScript.CreateObject("CmsDeployServer.CmsDeployExport.1")
If ( Err.Number <> 0 ) Then
	Call MsgBox(Err.Description, vbCritical, "Create Object Problem")
	Set pCmsDeployExport = Nothing
	Set file = Nothing
	Set fso = Nothing
    Quit
End If

'Authenticate the current user
pCmsDeployExport.AuthenticateAsCurrentUser
If ( Err.Number <> 0 ) Then
	Call MsgBox(Err.Description, vbCritical, "Authentication Problem")
	Set pCmsDeployExport = Nothing
	Set file = Nothing
	Set fso = Nothing
    Quit
End If

'Set the export options
Set pExportOptions = pCmsDeployExport.Options
If ( Err.Number <> 0 ) Then
	Call MsgBox(Err.Description, vbCritical, "Export Option Problem")
	Set pCmsDeployExport = Nothing
	Set pExportOptions = Nothing
	Set file = Nothing
	Set fso = Nothing
    Quit
End If
'Includes the full rights group in the .sdo file
pExportOptions.IncludeRightsGroups = 3
'Includes the creator in the SDO
pExportOptions.IncludeCreatedBy = 2

'Calculate the number of minutes since the last export
endTime = Now()
elapsedTimeInMinutes = CLng(DateDiff("n", startTime, endTime))

'Export to a unique .sdo file
sdoFileName = "Exported." & Replace(Replace(Replace(endTime,":","."),"/",".")," ",".") & ".sdo"
strReportUrl = pCmsDeployExport.Export(pathname & "\" & sdoFileName, elapsedTimeInMinutes, "")
If ( Err.Number <> 0 ) Then
	Call MsgBox(Err.Description, vbCritical, "Export Problem")
    Set pCmsDeployExport = Nothing
    Set pExportOptions = Nothing
	Set file = Nothing
	Set fso = Nothing
    Quit
End If

'If the export is successful, open the timestamp file, and the save the end time for the next export's start time.
Set file = fso.CreateTextFile(pathname & "\" & timestampFileName,True)
file.WriteLine(endTime)
'Write the report URL for auditing
file.WriteLine("http://localhost" & strReportUrl)
file.Close

Set pCmsDeployExport = Nothing
Set pExportOptions = Nothing
Set file = Nothing
Set fso = Nothing

'Optionally open the export report URL.
Set shell = WScript.CreateObject("WScript.Shell")
shell.Run "http://localhost" & strReportUrl, 7

MORE INFORMATION

For more information about the CmsDeployExport.Export method, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:6/19/2005
Keywords:kbtshoot kbBug kbprb KB900735 kbAudDeveloper kbAudITPRO