Share via


ContentDeploymentJob.Run method (Boolean, DateTime, String)

Executes a content deployment job based on the type of transformation within the referenced time by using the specified snapshot.

Namespace:  Microsoft.SharePoint.Publishing.Administration
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
Public Sub Run ( _
    runAsynchronously As Boolean, _
    deploySinceTime As DateTime, _
    sourceContentDBSnapshotName As String _
)
'Usage
Dim instance As ContentDeploymentJob
Dim runAsynchronously As Boolean
Dim deploySinceTime As DateTime
Dim sourceContentDBSnapshotName As String

instance.Run(runAsynchronously, deploySinceTime, _
    sourceContentDBSnapshotName)
public void Run(
    bool runAsynchronously,
    DateTime deploySinceTime,
    string sourceContentDBSnapshotName
)

Parameters

  • runAsynchronously
    Type: System.Boolean

    Specifies whether to execute the content deployment job synchronously or asynchronously.

  • deploySinceTime
    Type: System.DateTime

    Determines whether to deploy changes that have been made since the specified date and time..

  • sourceContentDBSnapshotName
    Type: System.String

    Specifies the name of a SQL snapshot which is to be used for an export operation.

Exceptions

Exception Condition
ContentDeploymentException

A specific reason is better described by the actual exception's message. Some common messages include:

  • An attempt is made to execute a job that is already running.

  • An attempt is made to execute a job that is in a timed out state (LastStatus property).

  • An attempt was made to run the job by using SQL snapshot for export, but SQL Server is being used and does not support SQL snapshots.

  • The SQL snapshot specified by sourceContentDBSnapshotName was not found.

  • Provided value of deploySinceTime specifies a time later than the time of the last successful run of the content deployment job.

SPException

Can be propagated from underlying Windows SharePoint Services (WSS) layers.

Remarks

If runAsynchronously is true, the method will start the execution of the content deployment job and can return before the execution of the content deployment job is complete, which in this case means the export phase of the job will run in the timer service. Otherwise, the method will not return until the execution is complete; in this case, the export phase of the job will run in the current process.

If deploySinceTime is set to MinValue, then the execution of the content deployment job propagates content to the target normally, as determined by the value of the ExportMethod property of the job. Otherwise, the execution of the content deployment job behaves as if the ExportMethod property was set to ExportChanges (regardless of the actual value of the property), propagating all changes that occurred on the source since the date and time specified by the deploySinceTime value. The value of deploySinceTime must be less than or equal to the time of the last successful run of the content deployment job (LastSuccessfulDeploymentTime property) and be a valid change time for the WSS Change Log; the log is periodically purged, which can make older change times invalid. Overriding the default behavior of the job execution by providing a specific value of deploySinceTime is an advanced option and should be used carefully with a deep understanding of content deployment and WSS Change Log in general, and with a clear understanding of what it is that the caller is trying to achieve.

If sourceContentDBSnapshotName is null or Empty, then the use of SQL snapshot for export during the execution of the content deployment job is determined by the value of the SqlSnapshotSetting property (see the SqlSnapshotSetting property for more information). Otherwise, the execution of the content deployment job will use SQL snapshot specified by sourceContentDBSnapshotName for export. In this case, if the SQL Server snapshot specified by sourceContentDBSnapshotName does not exist or if the SQL Server being used does not support SQL snapshots, then the execution of the job will fail.

If an attempt is made to execute a job that is already running or is in a timed out state (LastStatus property), execution of the job will fail.

See also

Reference

ContentDeploymentJob class

ContentDeploymentJob members

Run overload

Microsoft.SharePoint.Publishing.Administration namespace