Saturday, April 11, 2015

Migration from MOSS 2007 to Sharepoint Azure

Although there is lots of documentation already available on this i want to list the steps to migrate from MOSS 2007 to SharePoint Azure in simple language.

Now before we start, lets list some points to consider:

  • We can not directly Migrate from MOSS 2007 to SharePoint azure. We will have first migrate to SP 2010.
  • We will have to convert AD users to ADFS as explained here.
  • It is always a good practice to cleanup the SharePoint Database before we mount it on Azure Site.

Steps to Migrate

Step 1 : Make MOSS 2007 DB read only

  • On the MOSS 2007’s database server, click Start, point to All Programs, Microsoft SQL Server, and then click SQL Server Management Studio.
  • Traverse to Databases node by expanding the tree
  • Right-click the name of the database that you want to set to read-only, and then click Properties.
  • In the Properties dialog box, click the Options tab.
  • Under State, select the Database Read-only to True, and then click OK
Step 2 : Take MOSS 2007 DB Backup

  • Traverse to Databases node by expanding the tree.
  • Right-click the database you want to back up, point to Tasks, and then click Backup Database
  • In the SQL Server Backup dialog box, specify a name for the backup, select Back-up type – Full, select a destination, and then Click OK to start the backup process.
Step 3 : Restore this Backup on 2010 DB Sever.
Step 4 : Create a Web application on SharePoint 2010.
Step 5 : Remove the data base of new created web application and mount the restored DB.
  • This could be done using UI or power-shell. This is listed by Microsoft here.
Step 6 : Now we will test DB for any missing features and if we need to install any custom components on the on Azure.
Test-SPContentDatabase -Name <DatabaseName> -WebApplication <URL>
This URL explains thoroughly the report generated by Test command .

Step 7 : Based on the report generated in above step we will have to take appropriate actions.
Majorly there would be following things:
  • Missing features : Use the power-shell to remove the missing features(or orphaned features)
  • Install any third party components.
Step 8 : Once cleanup is done take DB back up of 2010 site.
Step 9 : Restore backup on Azure DB sever.
Step 10 :  Create a Web application on SharePoint 2013.
Step 11 : Remove the data base of new created web application and mount the restored DB.
Step 12 : Now that our Site is ready we will have to convert the Users.
Follow this link to understand how to convert.
Step 13 : Deferred Site Collection Upgrade
This is a replacement of Visual upgrade feature available in 2010. Its pretty simple and can be done using below mentioned power-shell command.
Get-SPSite -ContentDatabase WSS_Content -Limit All | Upgrade-SPSite –VersionUpgrade

Saturday, April 4, 2015

Migrating from AD to ADFS Sharepoint 2013 azure.

One of the problem we face when migrating to SharePoint 2013 azure is user migration as SP 2013 supports only Claim based authentication. So if your source SharePoint site is running on classic authentication, migrated users will not be able to login on 2013.
Another thing to consider would be that when we will migrate to Azure you domain will also change. On source it would be AD and on azure authentication provider would be ADFS.

But Microsoft has provided a solution to it. All you will have to do is to run Move-SPUser Command as mentioned here. Below mentioned power-shell script will convert all users of a site collection.

add-pssnapin microsoft.sharepoint.powershell
$url ="<Site Collection URL>"
#i:05.t|Domain-id-provider|username@domain.com
# get all users in the site, this includes iwindows users
$users = get-spuser -web $url -Limit ALL 
foreach($useriteration in $users)
{
     $a=@()
     $userlogin = $useriteration.UserLogin
    # get the user login name
    #Write-Host $userlogin
    if($userlogin.Contains("Domain\"))
                {
          $user = Get-SPUser -web $url -Identity $userlogin
          #Write-Host $user.Email
                  $userLoginInfo=$user.Email
                                if($userLoginInfo)
                                {
        #Write-Host $userlogin " = " $userLoginInfo
       Move-SPUser -IgnoreSID -Confirm:$false -Identity $user -NewAlias "i:05.t|domain-id-provider|$userLoginInfo"
                                                echo "User converted to claim with i:05.t|domain-id-provider|$userLoginInfo"
                        }
                                else
                                {
                                                echo "No email address map with user $userlogin"
                                }
                }
                else
                {
                                #echo "Non Domain user remains same $userlogin"
                }

}
Remove-pssnapin microsoft.sharepoint.powershell