Tuesday, 24 June 2014

How to do SharePoint 2010 Content Deployment

Good Article by Melick

http://www.codeproject.com/Articles/275792/How-to-do-SharePoint-Content-Deployment

There are many articles in the web by describing Content Deployment in SharePoint 2010. But most of the time (In my case it do not work fine always in first time Frown | :-( )  it is not working property and giving plenty of errors which direct us to restoring the backup rather than trying Content Deployment in the SharePoint Server.
Here I'm going to my experiences and how I'm resolving those errors and little bit of background about the  SharePoint Content Deployment. Luckily i have manage to successfully proceed with the SharePoint Content Deployment most of the time.

What is SharePoint Content Deployment 

Content deploy can be use to export (deploy) content from one site collection to another site collection. content deployment is taking care of following contents in the source site collection.
  • Web pages – Deploy corresponding images styles , master pages and etc.
  • libraries
  • lists
  • resources
Content Deployment do not deploy
  • programs
  • assemblies
  • features
  • configuration information(Web.config)
Most of the time Content Deployment fails due to features. in the later i will explain how to over come these issues.

How to Configure SharePoint 2010 Content Deployment

We will use following scenario for the deployment
image
First you need to create a site collection in the production server (Our One is production/sites/ALR) which you are going to use in the content deployment.
When you are creating I'm always using site template as Select Template Later in the Custom Tab.You can use the blank template also but I'm recommending this one  because this one worked for me  all the times.
image
After that you need to configure content deployment
For than go to Central Administrator –> General Application Settings–> Configure Content Deployment in the Production Server
image
go to this and 
  • allow Accept incoming content deployment jobs in Accept Content Deployment Jobs section.
 image
  • select Do not require encryption  in connection security.(If you want you can use https also. but for the moment select the other one. )
image
Then Go to Development Server and proceed following steps to configure deployment path and job.
First we need to Configure Deployment Job. For that Go to Central Administrator of the development machine and then General Application Settings and  then Configure content deployment paths and jobs.
image
then select New Job to create new content deployment job.
Then Specify Title and Description (Optional) and for the source application select Source Web Application as Development and Source Site site collection  as  /sites/ALR ( this is as per scenario you can choose your one)
then you need to give production server Central Admin URL with the Port to Destination Central Administration Web Application. here i found that some times we need to give the with IP addresses. but most of the time URL will work.
image
Then we need to provide authentication information. here most users are failing in this point (I were also). because what ever the selection we made we have to provide user name and password. Earlier i thought if we select windows authentication it does not need but it is not. Following shows sample values for  Authentication Information
image
after that select the destination Web Application and Site collection in Destination web application and site collection section.
image
For the moment leave Deploy User Names selected and Security Information All.
The SharePoint Automatically Create a Quick Deployment Job for you.
image  
For the moment leave this and create a Deployment Job by right clicking the Deployment Configuration.
image
Here you can schedule the content deployment but for the movement select following options but of cause you can change them as you want later.
SQL Snapshots --> Do not use SQL Snapshot
Scope --> Entire Site Collection

the clink and finish the job creation. then you will see following kind of a menu.
image
Now the hard part comes. In the Menu Click Run Now or Test Job. (I’m Recommending Test Job before actually run the Job. Because some times Run Now deploy content partially and failed thus better to Test the Job before it is actually run. ) Then Most of the Time you will get Test Failed. If Not you are very lucky, thus you can proceed with the Run Now. But if you get Test Failed (sure you are Smile | :) ) Following are the workaround you can fixed those errors.

Following are the most common errors you are getting..

Could not find Feature someFeature.
This error coming because this feature is not in the Production Server. Thus Install the Feature to the production server and run the Test Job again, then it will say another feature is missing thus keep on adding or removing unnecessary features in the development machine until it get succeed. You can find more feature details by using  power shell commands (click here).  
Could not find Feature FT-01-bbb35132-7695-139b-2e18-27444285e766.
These features are InfoPath Form Template Features. Thus get the relevant Form template and upload it to the production server.  The run the Test Job and see the progress.
If every thing finds most of the time you are getting these kind of errors.
  • An unexpected error has occurred
  • A list, survey, discussion board, or document library with the specified title already exists in this Web site. Please choose another title.
  • Unable to import the folder _catalogs/fpdatasources. There is already an object with the Id d029169b-1f86-4275-bb99-dd78a48f7952 in the database from another site collection.
These errors are coming because content database is having these objects and those are orphan in the site collection. thus you can repair the content database to delete these orphan objects in the particular site collection. 
thus you can use following power shell command to get rid of these errors (click here).

Content Deployment in SharePoint 2010

Nice Article by Archana Sarodia

http://www.e-zest.net/blog/content-deployment-in-sharepoint-2010/


This is part of the Enterprise Content Management in SharePoint; which addresses the feature of moving the Contents from Source Site to Destination Site.
Content Deployment
The complete Site collection can be Deployment or Subset of the Site can be deployed. This is an Incremental Process which deploys only changes and related resources to the destination Site. Quick Deploy feature allows single page deployment by the Author.
This is a one way process where in data is transferred from Source to Destination; so if any change is made in Destination Site those would be over written by this Deployment Process., also sometimes the process of Deployment may fail in case new Content is added or existing one is changed. Considering this it is recommended that the Destination Site has Security by which User is not allowed to directly access and change content in the Site.
Deployment includes:
  • Web Pages along with Images, Style sheet and layout page
  • Libraries
  • Lists
  • Resources used by the page
Deployment excludes:
  • Assemblies
  • Features
  • Configuration Information ie Web Config
Latest feature of Content Deployment in SharePoint 2010 is use of SQL Server Snapshot. In this option the Source Content Database snapshot is taken before the job starts.
Note: Quick Deploy option will work when the Source site Collection is using Publishing Portal Template or SharePoint Server Publishing Infrastructure feature enabled.
Deployment Paths and Jobs
Content Deployment Path defines the Source Site collection from which the deployment start and the Destination Site Path is the Collection to which content is deployed.
Other information associated is:
  • Authentication information of Destination Site
  • Deployment User name that are associated with the Content like the Author name
  •  Details of the Permissions to be deployed on the Content
Content Deployment Job defines the schedule of the Deployment Process for specific schedule and Path. A path can have multiple Jobs defined for Deployment.
Other information associated is:
  • Path to which it is associated
  • SQL snapshot used or not
  • Sites from Source to be deployed
  • Frequency of the Job
  • If notification to be sent on success of failure of Job with the e-mail ids
Types of Content Deployment Jobs:
  1. Incremental
  2. Full
  3. Quick deploy
Content Deployment Security
Permission on Destination and Source Server may differ; majorly the destination Server would have Active Directory Authentication; we may not have relationship between the 2 Servers.
Security Options while setting Content Deployment Path:
  1. All
  2. Role Definition Only
  3. None
How Content Deployment Works
Content deployment settings for Source and Destination Server can be configured for acceptance and rejection of incoming Content Deployment Jobs. You can specify the Servers from which the Content are to be accepted or destination Server for Outgoing data. Web service is the communication way between Source and Destination Server.
Following are the Steps from Start to Finish for Content Deployment Job:
Step 1) Check Change Token to identify when last successful Deployment was done. If the time difference is significant then the Jobs opt for Full Sync even if setting is for Incremental Update. Once verified the Deployment process starts; if snapshot option is selected then SQL Snapshot is taken
Step 2) Contents for the Deployment are identified and copied to a temporary folder and packed as .cab files. The Source Server is authenticated by the Web Service on the Destination Server; once authenticated the Web Service are called for Import on Destination Server.
Step 3) The .cab file from Source is copied to Destination Server temporary folder and Web Service is called to start the Import Process
Step 4) Content Deployment Job calls Web Service to check status of Import; if receives no response on Import within certain time; job will contain warning for Time Out of Job. Job requests for status eventually fails or re-runs the Job
Step 5) .cab file is extracted in the Temporary folder and imported on the Destination Server.
Step 6) On completion of Import either Success or Failure message is sent to the Central Administration Server. If success the changed token is saved else discarded for save.

Using Content Deployment to Copy One Site Collection to Another in SharePoint 2010

Good Article on Content Deployment by KC Young

Using Content Deployment to Copy One Site Collection to Another in SharePoint 2010


In simple terms, Content Deployment in SharePoint 2010 is used to deploy the content from one site to another site. We can set the content deployment jobs (incoming and outgoing) using SharePoint Central Administration 2010.
The two-farm topology is a standard Internet site topology and is typical of topologies that are used to publish an Internet site. It is usually composed of two server farms: one to host the authoring site collection and the other to host the production site collection.
It is important to be aware that content deployment is a one-way process. The content deployment feature does not support round-trip synchronization from source to destination and vice versa. Creating new content or changing existing content on the destination site collection can cause content deployment jobs to fail. Because of this, it is usually recommended to restrict permissions on the destination site collection so that only specific users can make direct changes to content that is stored within that site collection.
We will now go through a typical process that will copy one site collection to another with content deployment.
PROCESS OVERVIEW
Content Deployment in SharePoint 2010 is composed of the following three processes.
  1. Create two Web Applications in separate content databases and create site collections in the web applications.
  2. Configure Content deployment, paths and jobs -> Run jobs.
  3. Check the deployment status and the destination site collection’s content.
I. CREATING THE WEB APPLICATIONS AND SITE COLLECTIONS
1. First, create two web apps and ensure the two are in separate content databases.
  • http://spy2010
  • http://spy2010:1111
2. Second, create site collection http://spy2010/sites/authoring and select the “Team Site” template.

3. The initial content deployment destination must be a blank site collection.
4. Create a site collection and ensure that you select “<Select template later>.”
Note: DO NOT create a site collection using “Blank Site” template, as this does not count as an empty site collection and content deployment will fail.
5. The site collection in port 1111 is just http://spy2010:1111/sites/production.

II. Configure Content deployment, paths and jobs in CA
1. Navigate to Central Administration -> General Application Settings -> Content Deployment -> Configure Content Deployment.

2. Configure new deployment path

Note: A content deployment path is required to define a one-to-one relationship between a source and destination site collection for the purposes of content deployment. Once you have created a path, jobs can be scheduled and run on an ad-hoc basis to deploy additional content as required.
3. Select your “authoring” site collection as the source and “production” site collection as the destination.
4. Enter the current central administration address, including the port number.
Note: We will need to test the connection to make sure the destination site collection list populated correctly.

Create a deployment job and run it
5. We will need to create a deployment job. Jobs and deployment paths have a one-to-one relationship, so we will need to create at least one job for each path that we have specified.
6. Select the “One time only” radio button to kick the job off immediately.

7. Create a schedule or run the job now using the “One time only” option to test your new deployment path.

8. You can view current job status on the “Manage Content Deployment Paths and Jobs” page.


9. Once the job status becomes “Completed,” the “Production” site collection’s content has been copied successfully.

III. Check deployment status and destination site collection’s content
1. Navigate to Central Administration -> General Application Settings -> Content Deployment -> Check deployment of specific content.

2. We can check the “production” status on the following page.

3. When we login to “production,” we can see that the content is now same as the content in “authoring.”