Performing the content deployment

Content deployment jobs can be configured to run on a specific schedule or to only run when instructed to manually. In either case, we can manually start the content deployment job. In this recipe, we will manually start the deployment job created in the Creating the content deployment job recipe.

How to do it…

Follow these steps to start the content deployment job:

  1. Navigate to Central Administration in your preferred web browser.
  2. Click on General Application Settings.
  3. Click on Configure content deployment paths and jobs from the Content Deployment section.
  4. Select Run Now from the drop-down menu for the content deployment job as shown in the following screenshot:
    How to do it…

How it works…

Manually starting the content deployment job instructs the SharePoint timer job associated with the content deployment job to execute at the current date and time. Once the timer job runs, it will start the deployment job.

There's more…

Starting a content deployment job may also be accomplished with PowerShell or code using the server-side object model.

Performing content deployment using PowerShell

Follow these steps to start the content deployment job using PowerShell:

  1. Get the name of the content deployment job using the Get-SPContentDeploymentJob Cmdlet as follows:
    Get-SPContentDeploymentJob
    
  2. Start the content deployment job using the Start-SPContentDeploymentJob Cmdlet:
    Start-SPContentDeploymentJob "Staging Deployment Job"
    

Performing content deployment with code using the server-side object model

Follow these steps to start the content deployment job with code using the server-side object model:

  1. Get the content deployment job as follows:
    var job = Microsoft.SharePoint.Publishing.Administration.ContentDeploymentJob.GetInstance("Job Name");
  2. Start the content deployment job using the following line of code:
    job.Run();

See also

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.38.92