When the opportunity knocks to Migrate from existing MOSS (Microsoft Office SharePoint Server) 2007 Portals to SharePoint 2013 where the architecture has been turned to completely different comparing several features and elements that has been introduced, deciding the approach isn’t so easy when you have lots of customization in place. Also when there is a completely new concept of App Model is introduced where the code doesn’t necessarily lies on the server side to handle execution, deciding the approach is a really brainstorming exercise.
We all know that to implement customization we heavily depend upon Custom SharePoint features and solutions based upon our unique requirement of implementing business logic. Also from Migration perspective what change we need to consider is the approach that is involved to migrate the Class Library based SharePoint 2007 solutions to Visual Studio template based SharePoint 2013 solutions. In addition to this also what we need to decide is whether we really need to migrate from Server Side Object Model to the newly introduced App Model feature of SharePoint 2013. So this is from development perspective where a lot is required to be decided to finalize the approach. But there is lot to be implemented when we need to setup SharePoint 2013 in DEV, TEST and PROD environment. I mean to say there is lot to consider in Administration perspective as well when you migrate from MOSS 2007 to SharePoint 2013.
In this section we are specifically going to focus upon the term “AS IS MIGRATION” that means we are not going to introduce APP Model, we are just migrating whole content from SharePoint 2007 to 2013 keeping both the look and feel and functionality intact. Also we are not going to introduce any third party tools that will help us migrate the content directly from MOSS 2007 environment to SharePoint 2013 environment. Here we will introduce an interim SharePoint 2010 environment and use Database Attach method for the migration procedure.
So let’s go ahead and get started.
- Migration Strategy
- Migration using Database Attach Method
When we are not going for Tool based migration in our SharePoint 2013 Migration approach, there is not much way left to migrate from MOSS 2007 except the Database attach method. So we are taking this database attach methodology to proceed but in this scenario there is requirement of Interim SharePoint 2010 environment where we need to make our first leap and then move it to SharePoint 2013. Below diagrams demonstrate how we are going to move forward in this case.
So in this scenario we are taking the below points into consideration.
- Separate SharePoint 2013 farm infrastructure is to setup for migration
- Database is set to read only while migrating from SharePoint 2007 to 2013.
- Requires interim migration from MOSS 2007 to SharePoint 2010 however it doesn’t require full setup of the farm such as configuring WFE, Application and Database server, minimal infrastructure to configure SharePoint 2010 environment is enough (Minimal infrastructure indicates having separate SharePoint and DB server, you may not go for installation in a single server as it might cause issues in future.). We will simply use this to transfer the database in between.
- Migrating the customizing code that has been used is one important perspective. In this case the migrated assemblies and their versions must match with the existing Assemblies and their versions otherwise it will end in showing up errors in page.
So in this article we will try to cover as much as we can from SharePoint Administration and as well as Development Perspective.
INSTALLATION AND CONFIGURATION OF SHAREPOINT 2010 ENVIRONMENT
I believe the existing MOSS 2007 environment is already there so what we need to do in the first place is to set up the Interim SharePoint 2010 environment which can be found in so many articles/ blog posts over the net. One of the blog that I found is here.
Although you might not need to create so many service accounts as its sole purpose is to use it for Database Migration. Still I will suggest there should be one account (preferably domain admin) solely created for this installation and configuration purpose.
I will also suggest to download the SharePoint prerequisites installers separately (if you are planning to install it in an internet free environment) and keep it in the server in a separate location.
While installing the pre-requisites there is no particular sequence to be maintained for SharePoint 2010 but we will see later on this tutorial that for SharePoint 2013 there is a particular sequence to be maintained and followed failing which the whole server is required to be formatted and recreated for the installation purpose.
Anyways While installing SharePoint 2010, select “Server Farm” option as we are not going to configure a standalone environment. Also select “Complete” as server type
After the installation later on this article we will decide to setup our SharePoint 2013 farm which will actually host our migrated Web Applications.
Taking the Content Database Backup of MOSS 2007 websites
Set the databases to read-only before taking backups.
• 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
Backup the database:
Follow these steps to take back-up:
• 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.
Restore the Backup on SharePoint 2010 SQL server
• Open the SQL Server Management studio, traverse to “Databases” node. Then right click the “Databases” node and choose “Restore Database…” from the context menu.
Specify the Database name, Restore Source, Destination, File names in the screens.
• Click “OK” to start the restore operation and Wait for the restore to complete! The time of restoring database depends upon the database size and server’s capacity.
• Make the Read-Only database to false after restore
Remove content database of the newly created web application in SharePoint 2010
Remove content database of the newly created web application in SharePoint 2010
Now, we need to delete the content db of the newly created web application in order to avoid any URL conflicts. Run the below stsadm command:
stsadm -o deletecontentdb -url <http://url> -databasename <MOSS2007_Migration_Content>
Attach restored database with the newly created web application in SharePoint 2010
• Test the content database: Before attaching the content databases to the Web applications, use the Test-SPContentDatabase PowerShell cmdlet to verify that all of the custom components that you need for that database. It checks for all artifacts such as feature, setup files, web parts etc. that are referred in the content database are installed in the farm and provide you with a report.
• Test-SPContentDatabase -Name <DatabaseName> -WebApplication <URL>
• Delete the corrupted objects
• stsadm -o databaserepair -url <URL of SharePoint site> -databasename <name of database> -deletecorruption
• Attach the Content DB to Webapplication
• Finally, we need to attach the restored MOSS 2007 database to SharePoint 2010 by running the STSADM command
The Content DB containing the root site collection is always applied first.
The other content DBs can be applied in any order. Attach the Content DB of the Root Site collection First. And then Attach the Content DBs of other Site Collections.
stsadm.exe -o addcontentdb -url <URL of SharePoint site> -databasename <MOSS2007_Portal_Content>
- Or you can use the PowerShell cmd-let: Mount-SPContentDatabase
Mount-SPContentDatabase -Name <DatabaseName> – databaseServer <ServerName> -WebApplicationURL
Create Service Account in the domain in order to adhere to Medium Security Option (Sweet Spot). Please refer to the below link for more details. In this case we are hereby creating the below service accounts.
For the SQL Server
For the SharePoint Server
If we need to install visual studio Office Developer Tools for Visual Studio 2012 which in Development Environment we can follow the below steps.
1) Download Microsoft Office Developer Tools for Visual Studio 2012
follow this link
2) Once it’s downloaded, open PowerShell and run the following command:
WebpiCmd.exe /offline /products:OfficeToolsForVS2012RTW /Path:C:\Temp\OfficeToolsForVS2012RTW
3) So what we will do is download the WebPi binaries from here:
Copy the msi from download location to C:\Temp\OfficeToolsForVS2012RTW
4) Copy the entire Directory
C:\Temp\OfficeToolsForVS2012RTW to some Location in D:\Softwares\OfficeToolsForVS2012RTW
5) Run the Below Command
Start-Sleep -s 120
D:\Softwares\OfficeToolsForVS2012RTW\bin\WebpiCmd.exe /install /products:OfficeToolsForVS2012RTW /XML:D:\Softwares\OfficeToolsForVS2012RTW\feeds\latest\webproductlist.xml /AcceptEula
INSTALLING AND CONFIGURING SHAREPOINT 2013
Whenever it comes to install SharePoint 2013 or Configuring SharePoint 2013 farm we need to install pre-requisites manually in a particular sequence in order to prperly configure SharePoint 2013. Also this installation procedure requires the prerequisites to be installed in each SharePoint Servers before we can actually continue with our actual SharePoint 2013 installation.
There is good blog post I find here in the internet about installation of the pre-requisites and their sequence. Here it is
Anyways I am stating the prerequisites that are required. One thing I need to specify over here that it is very important – the installation of AppFabric in the server. If it is not installed in this sequence and there is an error in installing Appfabric later, then nothing can be done. You will end up in formatting the whole system to start for a fresh installation of SharePoint.
Other installations are pretty simple only the installation of Appfabric is not straightforward. To install it you need to run command prompt and run it as Administrator and then type the following command to trigger prerequisiteinstaller.exe to run Appfabric which is downloaded at the below location. After running this command the pre-requisite installer will fire up and then it will install Appfabric.
- Microsoft .NET Framework 4.5
- Windows Management Framework 3.0
- Microsoft SQL Server 2008 R2 SP1 Native Client
- Windows Identity Foundation (KB974405)
- Windows Identity Extensions
- Microsoft Sync Framework Runtime v1.0 SP1 (x64)
- Microsoft Information Protection and Control Client
- Microsoft WCF Data Services 5.0
- Windows Server AppFabric
- Cumulative Update Package 1 for Microsoft AppFabric 1.1 for Windows Server (KB2671763)
Later on this stage the installation is quite straight forward for SharePoint 2013 only on the configuration peospective you have to select “Complete” as we are going to add more servers into the farm. In this scenario we will have two SharePoint Front End web servers, Two Application servers and one database cluster which will have one Alias(CNAME) of DB001.DOMAIN.COM.
The network architecture will look something like this while having two Front end, two Application and one database cluster in place. The Front end servers will be in a different subnet than the Application servers and the database cluster will be in a different subnet than the Application servers. Please follow the following steps in order to install and configure SharePoint 2013.
- Download and distribute SharePoint 2013 prerequisites in the SharePoint servers and keep it in a fixed location.
- Copy the SharePoint 2013 installer with its key in each of the servers(except the DB server).
- Install the pre-requisites in the server keeping the order same as mentioned before.
- Install SharePoint 2013 after installation of SharePoint prerequisites are done. While installation select “Complete” and specify the Configuration Database server as DOMAIN.COM. Configure Central Administration in one of the Application server and later on while configuring add other SharePoint servers as well using the Passphrase that you have mentioned earlier.
Below steps we need to configure for to setup service account as farm administrator
Add SERVICE Account as Farm Administrator
Make sure that account “domain\farmadmin001” is added inside Farm Administrator Group in Central Administration if it is not there. Go to Central Administration–>Security–>Manage the Farm Administrator Group
Configure Manage Accounts
From The Central Administration go to Security –> “Configure managed Accounts” under “General Security” Click on Register Managed Accounts and Set up the accounts as follows:
SharePoint version number: 15.0.4569.XXXX. This is available from the central admin. This number is important when backing up and restoring sites as you cannot restore on to a server where the version number is lower than the one from where the backup was taken. Also this number gives you information on the installed service packs.
Services running on the server:
- Business Data Connectivity Service
- Managed Metadata Web Service
- SharePoint Server Search
- State Service
- Secure Store Service
- Usage and Health Data Collection Service
- User Profile Synchronization Service
- Word Automation Services
- .net Session State Service
- Server: DB001.DOMAIN.COM
- Configuration database: SharePoint_2013_Config
Configure Service Applications
For Service applications we will need to run one PowerShell script to automate the Service Application Creation. Along with that we will configure Search Topology and other required solution preparation environment.
Edit the following PowerShell script ConfiguringServiceApplicationsScript.ps1.
We need to pass the below parameters inside of the PowerShell Script as follows.
Creating Service Applications
Now run the PowerShell Script by Opening Windows PowerShell ISE as Administrator. Opening the Script and hit “F5”
The process should successfully complete. Message should appear as “”Search Configuration Done Successfully”
Go to Central Administration > Application Management > Manage Service Applications
The Screen should now be visible with all the Service Applications along with their Proxies in a list.
Now we will do configuring Search Topology using the below powershell script
CONFIGURING SEARCH TOPOLOGY
Configuring Search Service Application
Creating a Web application for the site
Create a new web application following the steps below for the portal:
If the SharePoint Central Administration website isn’t already open, select Start > All Programs > SharePoint Central Administration. Run SharePoint Central Administration as Administrator.
- Click on the Application Management link in Central Administration web site.
- Click on the Manage Web Applications link then click on New link in the ribbon menu to create new Web application
- On the Create New Web Application page, enter the following required information, including the port number and then click OK button.
Deploying Custom and Third Party Solutions
Open “SharePoint 2013 Management Shell” by clicking the same link at Start menu and Run the program as Administrator.
Add-SPSolution -LiteralPath <SolutionPath>
After adding the solutions those can be visible in the Solution Store inside Central Administration. Go to SharePoint 2013 Central Administration àSystem Settings àManage Farm Solutions. The Solutions are now visible in the list.
Deploy the solution by running the below line of commands
Next is to deploy the solutions by running the following command or it can be deployed using Central Administration.
- Install-SPSolution –Identity solution.wsp –WebApplication http://webApp:1234/ –GACDeployment:$true -force:$true
To deploy a solution from Central Administration you simply need to click on the link of the Solution and in the page Click Deploy Solution.
Create a Site Collection in both Web Applications
Run the following command in PowerShell along with the below parameters
$farmaccount = “domain\farmacc001”
$contentdb = “WSS_ContentDB_2013”
New-SPSite http://WebApp:1234/ -owneralias $farmaccount -name “Sample Web Application” -language 1033 -Template “STS#0” -ContentDatabase $contentdb -ErrorVariable err
If Site Collection gets created successfully then restore the backup from DEV environment to Test
The STSADM.exe is located at the below location:
“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\BIN”
- STSADM –o restore –url http://WebApp:1234/ -filename [Backupfilename] -overwrite
- Insert an entry inside the PageParserPath element of Web.Config file to allow server side code
- Insert an entry inside the Safe Control Section of web.config
Enable ASP.net Session State Service
Enable SPSession State Service by running the following command in SharePoint 2013 Management Shell.
“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\template\layouts\1033”
Configure the Alternate Access Mappings
From the central admin, open the operations tab and select “Alternate Access Mappings”.
Disable Loopback check
Run Windows PowerShell as Administrator and type the following command to disable Loopback Check. Please open your site in internet explorer to test if the Site is opening in the browser.
New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name “DisableLoopbackCheck” -Value “1” -PropertyType dword