Microsoft KB Archive/900735

= The .sdo file does not contain all the approved postings in MCMS 2002 =

Article ID: 900735

Article Last Modified on 1/15/2007

-

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 = &quot;C:\SDO&quot; timestampFileName = &quot;sdoTimestamp.txt&quot;

'Set the FSO variables Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;) 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 & &quot;\&quot; & timestampFileName, ForReading) startTime = file.ReadLine file.Close

'Create a CMSDeployExport object Set pCmsDeployExport = WScript.CreateObject(&quot;CmsDeployServer.CmsDeployExport.1&quot;) If ( Err.Number <> 0 ) Then Call MsgBox(Err.Description, vbCritical, &quot;Create Object Problem&quot;) 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, &quot;Authentication Problem&quot;) 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, &quot;Export Option Problem&quot;) 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(&quot;n&quot;, startTime, endTime))

'Export to a unique .sdo file sdoFileName = &quot;Exported.&quot; & Replace(Replace(Replace(endTime,&quot;:&quot;,&quot;.&quot;),&quot;/&quot;,&quot;.&quot;),&quot; &quot;,&quot;.&quot;) & &quot;.sdo&quot; strReportUrl = pCmsDeployExport.Export(pathname & &quot;\&quot; & sdoFileName, elapsedTimeInMinutes, &quot;&quot;) If ( Err.Number <> 0 ) Then Call MsgBox(Err.Description, vbCritical, &quot;Export Problem&quot;) 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 & &quot;\&quot; & timestampFileName,True) file.WriteLine(endTime) 'Write the report URL for auditing file.WriteLine(&quot;http://localhost&quot; & 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(&quot;WScript.Shell&quot;) shell.Run &quot;http://localhost&quot; & strReportUrl, 7



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

http://msdn2.microsoft.com/en-us/library/ms949747.aspx

Keywords: kbtshoot kbbug kbprb KB900735

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.