Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am running some Content Deployment jobs using the code but the jobs are not run incrementally, instead they are run by exporting all the objects. Is it possible to run them incrementally using the code below?

 ContentDeploymentJobCollection collection = ContentDeploymentJob.GetAllJobs();    
 foreach (ContentDeploymentJob job in collection)
 {    
       job.Run(true); //run the job asynchronously                                   
 }
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

SharePoint 2007 give you option to run content deployment with the option to select full or incremental job. In SharePoint 2010, that option is no longer available via the central administration site. The way arround it is to run the above command with powershell. You can set the following PowerShell to configure the Content Deployment to be run incrementally:

$PathName                   = "Test Path"
$JobName                    = "My Job"
$IncrementalEnabled         = $true


Write-Host -ForegroundColor White "- Creating content deployment job"
$CTJob = New-SPContentDeploymentJob -Name $JobName -SPContentDeploymentPath $PathName -IncrementalEnabled:$IncrementalEnabled -ScheduleEnabled:$false

In the object model you can call your CD job using

job.ExportMethod = SPExportMethodType.ExportChanges;
job.Run(true, job.LastSuccessfulDeploymentTime);   
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.