Thursday, September 4, 2014

Common Migrations 2007 t0 2013 issues and planning Important


Migrate from MOSS 2007 to SharePoint 2010 - Step by Step


In this article, I'm walking through Migrating from MOSS 2007 to SharePoint 2010 using database attachment method.

Overview
  1. Run Preupgradecheck in MOSS 2007 server.
    1. Analyze & Fix the issues.
  2. Take the back up of content database from MOSS 2007.
  3. Restore the content databases backup to SQL Server of SharePoint 2010.
  4. Create web application in SharePoint 2010.
  5. Attach the MOSS 2007 content databases to SharePoint 2010.
  6. Post Migration fixes

1. Run preupgradecheck in MOSS 2007 Server

This will be our primary analysis and reporting tool providing us with invaluable information regarding your SharePoint 2007 farm and actions that may be required to be taken prior to upgrading to SharePoint 2010. It is better to have October CU: http://support.microsoft.com/kb/976730/ where the preupgradecheck is enhanced further.

Run the preupgradecheck as below in command prompt:

stsadm.exe -o preupgradecheck

stsadm.exe -o preupgradecheck Report
Once you get "Operation completed successfully", it will launch the “SharePoint Products and Technologies Pre-Upgrade Check Report”. It can also be located under the following location;
%COMMONPROGRAMFILES%\Microsoft Shared\Web Server Extensions\12\Logs\

1(a). Analyze the report and Fix the following settings:

2. Take the Content Database Backup from MOSS 2007

Set the database to read-only before taking backups.
Set the database as read only:
  1. On the MOSS 2007’s database server, click Start, point to All Programs, Microsoft SQL Server, and then click SQL Server Management Studio.Take the Content Database Backup from MOSS 2007

SQL Server 2005 Management Studio Splash Screen


  1. Traverse to Databases node by expanding the tree.
  2. Right-click the name of the database that you want to set to read-only, and then click Properties.
4. In the Properties dialog box, click the Options tab.
5. Under State, select the Database Read-only to True, and then click OK
Set SharePoint Content Database to Read-Only

Backup the database:
Follow these steps to take back-up:
  1. Traverse to Databases node by expanding the tree.
  2. Right-click the database you want to back up, point to Tasks, and then click Backup DatabaseBackup SharePoint Content Database from SQL Server
3. 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.
Backup SharePoint Content Database from SQL Server

4. Repeat these steps to back up the databases that are used by MOSS 2007 in the environment.

3. Restore the back up on SharePoint 2010’s SQL Server:

  1. Open the SQL Server Management studio, traverse to “Databases” node. Then right click the “Databases” node and choose “Restore Database…” from the context menu. Restore SharePoint 2007 Content Database to SharePoint 2010
  1. Specify the Database name, Restore Source, Destination, File names in the screens.
Restore MOSS 2007 Content Database to SharePoint 2010
3. 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.

4. Create web application in SharePoint 2010

  1. In the SharePoint Central Administration, click on “Application Management” and click on “Create or extend Web application” under “SharePoint Web Application Management”.
  2. Again click on “Create Web application”. Set the settings according to the needs say http://SharePoint2010.company.com
  3. Don’t create any site collection.
  4. Install & Copy the solutions, file system changes (like images, themes) from MOSS 2007 to MOSS 2007 servers.

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://SharePoint.company.com -databasename < MOSS2007_Migration_Content>

Remove SharePoint Content Database: stsadm -o deletecontentdb

5. 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 an report.

Test-SPContentDatabase -Name <DatabaseName> -WebApplication <URL>

Delete the corrupted objects

stsadm -o databaserepair -url <URL of SharePoint site> -databasename < name of database> -deletecorruption

Finally, we need to attach the restored MOSS 2007 database to MOSS 2007 by running the STSADM
  1. The Content DB containing the root site collection is always applied first.
  2. The other content DBs can be applied in any order.
Important:
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 http://SharePoint.company.com -databasename < MOSS2007_Portal_Content>

Attach Content Database to SharePoint

Or you can use the PowerShell cmd-let: Mount-SPContentDatabase
Mount-SPContentDatabase -Name <DatabaseName> -DatabaseServer <ServerName> -WebApplication <URL> 

Post Migration fixes

Once the content database attachment process is over, we have to manually fix the below things:

Unit Test:

Browse the migrated sites in SharePoint 2010 and check their look& feel and functionality.
SharePoint 2010 look and feel
Before and After:
MOSS 2007 to SharePoint 2010 - Before and After Screen

References:


 

Preupgrade Issues and command

1.       No source code is available for MOSS 2007 customizations done earlier.
Resolution: Thankfully dlls were compiled for any CPU. We took the copies of dlls from GAC in MOSS 2007.
2. MOSS 2007 with SP1 and we can not install SP2 on production due to possible uncertain issues that can happen with existing live portal.
Resolution: SP2 is required to run the preupgrade checks before migration. Created a separate 64 bit MOSS 2007 environment with SP2. Restored database backup from production MOSS 2007 environment to test MOSS 2007 environment. Upgraded the database to SP2.
3. No solution packages are available to identify other files such as custom images and aspx pages.
Resolution: There were few custom images used on the portal. Copied all the images from production environment to test MOSS 2007 environment without replacing the duplicates. Filtered the new images folder by modification date to identify custom images used.

 

5.1 file not found, could not load assembly, etc.

Resolution: Added dlls in GAC of test MOSS 2007 environment. Since there were many dlls used (bad programming by old MOSS 2007 developers). Every control, web part had separate dll. Created PowerShell script to add dlls in GAC using gacutil.

Below script adds all the dlls in current directory to GAC and restarts the IIS to take effect.

1
2
3
4
5
6
foreach ($file in Get-ChildItem -Filter "*.dll" )
{
Write-Host $file.Name
.\gacutil.exe /nologo /i $file.Name
}
iisreset

5.2 The control is not marked as Safe Control.
Resolution: Copied all the custom safe control entries from web.config of production web application to test MOSS 2007 web.config.

5.3 Web part/control errors due to missing appsettings in web.config
Resolution: Copied all the custom appsettings from web.config of production web application to test MOSS 2007 web.config.

5.4 Error in webparts using SSP (user profile).
Resolution: Removed these web parts since they were no longer required. You can review the code using reflector and create a new webpart for the SharePoint 2010 environment.

When I restored the database of SP 2007 (64 bit) on SP 2010 web application, everything was working perfectly fine when I accessed site using application server url but when I used web server url, only top level site collection was working. For other site collections, I was getting page not found error. But alternate access mappings saved me and thanks to Paramesh for his help on Microsoft forum.

2. After migration to SharePoint 2010 site, some of the navigation links were missing from quick launch, top navigation bar and TOCPart web part. This was due to the default limit of 20 for global and local dynamic child limit under navigation settings. Increased the limit to 100 and it solved the purpose. Used below PowerShell script to increase the limit.

1
2
3
4
5
6
7
8
9
10
11
$webapp = Get-SPWebApplication http://sp2010server:1000
foreach ($s in $webapp.Sites)
{
foreach($web in $s.AllWebs)
{
$pubWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$pubWeb.Navigation.GlobalDynamicChildLimit = 100
$pubWeb.Navigation.CurrentDynamicChildLimit = 100
$pubWeb.Update();
}
}

3. Moving site to https binding.

We need to install SSL certificate on server in order to open site in secure i.e https protocol.
Modified website bindings in IIS and added https binding with above SSL certificate. Modified alernate acces mappings to add https url.

Read more: http://www.sharepointdiary.com/2011/09/migrate-from-moss-2007-to-sharepoint-2010.html#ixzz3CLyTU86h