Monday, July 30, 2012

Migrating Site From SharePoint 2010 to SharePoint 2013

This is a quick overview about Migrating SharePoint 2010 site to SharePoint 2013 environment.
There is nothing special about this particular migration , everything remains the same as we moved sites from MOSS 2007 to SharePoint 2010, however in my case I faced few issues after migrating to SP2013 because default is claims in SharePoint 2013 and site on SP2010 was using NTLM authentication. we will see this in details later section of this post.

Lets see step by step procedure to migrate a default SharePoint 2010 team site to SharePoint 2013 by database attach method. our SP2010 team site has a custom web part on its home page. the web part is populated by deploying a farm solution on SP2010 server.

First thing first -
Create new web application - create a new web application on on SP2013 server where we will be creating the migrated site. do not create the site collection on it as attaching the content database is going to avail the sites on created web application.

Deploy Farm Solution (if any) - in our case we have the farm solution deployed to SP2010 environment so lets go ahead and deploy the same farm solution to the new SP2013 environment. this is just to make sure that you have all your custom SharePoint components and assemblies present in the new environment.


Backup and Restore SQL db - next thing , open up the SQL Server management studio on SP 2010 environment, find your site db and perform a backup operation. this is pretty simple using SQL Server management studio and with a few clicks you can get backed up db file on file system. after this copy the back up file to SP2013 server and paste on file system.
Now again open up SQL server management studio in new environment and restore the database by creating a new database.






Test Database - once the database is restored on the new environment - perform a following check on db. this is just to make sure that the new environment has all needed components that the old SP2010 site is using. you can do this using powershell command - Test-SPContentDatabase


as you can see above - after running this command even thought I didnt get any error message - I got message which says something about authentication part. this is because the site we are trying to migrate is using classic windows authentication however in new SP 2013 - default is claims. lets ignore this message for now and lets go ahead and attach this database to new web application on SP2013.

Attach Database  - now as we are set to attach the database to the newly created web application on SP2013 , lets run the command which perform this operation for you. Its a powershell command - Mount-SPContentDatabase
Please note that this command takes few minutes to perform the required operation.


Browse the site - once this is done - open up the central administration and change the site collection administrator of new site. This is needed to be done when you are working with two different farms and domains are different.
After this try browsing the site - in my case I got few errors related to claims based authentication. but I used a workaround for this.

As the new environment needs claims and old site uses windows authentication - I disabled and enabled the claims authentication on new web application using powershell command like this

$objWeb = Get-SPWebApplication http://yourwebapplication
$objWeb.UseClaimsAuthentication=0
$objWeb.Update()

and now enable claims authentication again
$objWeb = Get-SPWebApplication http://yourwebapplication
$objWeb.UseClaimsAuthentication=1
$objWeb.Update()

 above workaround worked in my case and I was able browse the site.


If you observe at the top - SharePoint suggests to upgrade the look and fill to SP15. so lets click on start now - it launches a page where you can check the overall progress.


Once this all is done - visit the site and check the modified look. you can even see the custom web part on new site page.



8 comments:

  1. Thanks Sushil , glad that this helped you

    ReplyDelete
  2. So the end result of the above steps is that you have two content databases. Once for the 2013 web application (sans site collection) and the upgraded 2010 content DB / site collection.

    Correct?

    ReplyDelete
  3. I appears so, I'm not doing it. You are required to create the content database with the web app and if you point the new web app to the old database, it says that it must first be upgraded. Try doing that and you will get...
    stsadm.exe -o upgradetargetwebapplication has been deprecated since gradual upgrade is no longer supported in the current version.

    ReplyDelete
  4. How can I migrate the whole sharepoint database, site collections, sites anc configuration from one machine to another?

    ReplyDelete
  5. Let me know if you can help in below issue;

    I am trying to migrate SP 2010 to SP 2013 using contend db upgrade method.

    Before runing Test-SPContentDatabase command I deployed all the custom wsps.

    But still I am getting feature not found. No change in GUIDs.

    I deployed branding feature in compitible mode and rest of other features are in native mode.

    upgrade error log shows both types of features are missing.

    But when I create Site Collection on default content database then I can see custom features are avaiable.

    I had followed same steps as you described in your post except one change in wsp deployment.

    I had deployed branding wsp in compatible mode (14) and rest of features are native mode (15) with same GUID. Still I am getting both type of features marked as missing.

    After upgrade failuer when I browse Site collection/_layout/Settings.aspx, I found OOB features like Site Collection Feature page, List and Library page etc were throwing exception.


    Thanks in advance

    - Sudarshan S Vatturkar

    ReplyDelete
  6. Hi,
    strange..did you try deploying all features in compatible mode?
    also when your wsp gets deployed on the server , do you see your feature and related files on the file system on the server (in 14 hive?)

    ReplyDelete
  7. Thanks for sharing this great information. I would appreciate this excellent write-up.
    Though due to less technical expertise, I previously used an automated tool named Lepide SharePoint migration i.e, http://www.lepide.com/lepidemigratordocuments/sharepoint-to-sharepoint-migration.html that was really helpful to me. Although I have fulfilled my requirement and have successfully moved from SharePoint 2010 to 2013. However, I would like to bookmark and go through this informative article to obtain more information for upcoming projects.

    ReplyDelete