Configuring the source site collection for content deployment

Content deployment in SharePoint 2013 is handled at the site collection level. New to SharePoint 2013, we must first activate the Content Deployment Source Feature. This new feature provides a report containing a list of features currently activated that are not supported by content deployment. In addition, this feature makes the site collection available in the list of site collections to use as the source when creating our content deployment connection in the Creating the content deployment path recipe.

Getting ready

For this recipe, we should have a source site collection and a target site collection created. They should both be created with the same site template, such as the Publishing Site template.

Note

The source and target site collections must be in separate content databases. They can be in the same web application as long as they are in separate content databases.

How to do it…

Follow these steps to configure the source site collection for content deployment:

  1. Navigate to the source site collection in your preferred web browser.
  2. Click on Site settings from the Settings menu.
  3. Click on Site Collection Features from the Site Collection Administration section.
  4. Activate the Content Deployment Source Feature.
  5. Click on Site settings from the Settings menu.
  6. Click on Content Deployment Source Status from the Site Collection Administration section. The Content Deployment Source Status page displays a list of features and other content that would result in a failed content deployment operation as shown in the following screenshot:
    How to do it…
  7. Deactivate any features and delete any content listed on the Content Deployment Source Status page. For any features listed as hidden, they can be deactivated using PowerShell. For instance, the Ratings feature can be deactivated by removing the feature identifier that matches the feature from the collection of features activated on the site collection:
    $site = Get-SPSite http://sharepoint/sitecollection
    $site.Features | Where-Object { $_.Definition.DisplayName –eq "Ratings" } | ForEach-Object { $site.Features.Remove($_.DefinitionId) }
    
  8. Once each item has been addressed, the Content Deployment Source Status page will indicate that the site collection is ready for content deployment as shown in the following screenshot:
    How to do it…

How it works…

SharePoint 2013 uses the Content Deployment Source Feature to identify which site collections to make available when configuring a content deployment path. A content deployment path defines the source and the target for deploying content. In addition, this feature makes available the Content Deployment Source Status page that displays features from the source site collection known not to be compatible with content deployment.

The Content Deployment Source Status page will only list incompatible features that are included with SharePoint. If you have third-party or custom solutions, you should test them in a nonproduction environment to ensure they work with content deployment operations.

There's more…

Activating a site collection feature may also be accomplished with PowerShell or code using the server-site object model. When doing so the feature identifier for the Content Deployment Source Feature is cd1a49b0-c067-4fdd-adfe-69e6f5022c1a.

Configuring the source site collection for content deployment using PowerShell

Follow these steps to activate the site collection feature using PowerShell:

  1. Get the source site collection with the Get-SPSite Cmdlet as follows:
    $site = Get-SPSite http://sharepoint/sitecollection
    
  2. Ensure the feature is not already activated on the site collection. If the following command returns a value, it is already activated:
    $site.Features[[GUID]"cd1a49b0-c067-4fdd-adfe-69e6f5022c1a"]
    
  3. Activate the feature by adding the feature identifier to the features collection on the site collection as follows:
    $site.Features.Add([GUID]"cd1a49b0-c067-4fdd-adfe-69e6f5022c1a")
    

Configuring the source site collection for content deployment with code using the server-side object model

Follow these steps to activate the site collection feature with code using the server-side object model:

  1. Get the source site collection in a using statement as follows:
    using (var site = new SPSite("http://sharepoint/sitecollection"))
  2. Ensure the feature is not already activated on the site collection. If the following command returns a value, it is already activated:
    if (site.Features[new Guid("cd1a49b0-c067-4fdd-adfe-69e6f5022c1a")] == null)
    
  3. Activate the feature by adding the feature identifier to the features collection on the site collection as follows:
    site.Features.Add(new Guid("cd1a49b0-c067-4fdd-adfe-69e6f5022c1a"));
..................Content has been hidden....................

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