Top Menu

Showing posts with label Migration. Show all posts
Showing posts with label Migration. Show all posts

Wednesday, December 3, 2014

Friday, March 29, 2013

PowerShell - List Data Migration

Scenario:
I had to migrate data from ListA to ListB with the condition that values in Created By, Create Date, Updated By and Update Date columns must not be changed in ListB.

So I wrote this little PowerShell script to do the job.

Solution:
cls;

[void][reflection.assembly]::Loadwithpartialname("Microsoft.SharePoint")

$Site=[Microsoft.SharePoint.SPSite]("http://sharepoint01:1100")
$SiteWeb = $Site.openWeb()
$SourceList = $SiteWeb.Lists["ListA"]
$DestinationList = $SiteWeb.Lists["ListB"]

$ItemsColl = $SourceList.items

write-host "Total items found: " $SourceList.items.count

foreach ($Item in $ItemsColl) 
{

    write-host "Copying Item: " $Item["Title"]

    $NewItem = $DestinationList.items.Add()
    $NewItem["Title"] = $Item["Title"]
    $NewItem["Author"] = $Item["Author"]
    $NewItem["Editor"] = $Item["Editor"]
    $NewItem["Modified"] = $Item["Modified"]
    $NewItem["Created"] = $Item["Created"]
    $NewItem.Update()

}

$Web.dispose
$Site.dispose

write-host "All items have been copied successfully."

Monday, April 2, 2012

Migrating SharePoint 2007 site to SharePoint 2010

Recently, I had to come up with a strategy to migrate our company's internal SharePoint based website from MOSS 2007 to SharePoint 2010 platform and the following MSDN article made my life so much easy:

URL: http://technet.microsoft.com/hi-in/library/cc263299(en-us).aspx

There were no custom developed components however there were many major customizations in different sections of the site collection, so we planned to followed the below steps:

  1. Prepare the new SharePoint 2010 Farm/Server.
  2. Detach the Content Database from the SharePoint 2007 web application.
  3. Move the Content Database to the new SQL Server.
  4. Create a new Web Application in SharePoint 2010.
  5. Attach the Content Database to the new Web Application.
  6. Verify data and functionality.
  7. Some customizations might/will stop working so you need to fix them or in some cases re-do them.
In short I have to follow the same strategy which I have used for migrating the site from SharePoint 2003 to SharePoint 2007.

Tuesday, July 14, 2009

SharePoint 2003 to MOSS 2007 Migration

Senario: You have two servers. One has SharePoint 2003 and other have MOSS 2007 installed. You want to migrate a website collection from SharePoint 2003 to MOSS2007.
Scan the SharePoint 2003 Website
1. PreScan Tool
prescan.exe /c preupgradescanconfig.xml /v http://intranet2. Check the Orphan Records
stsadm -o databaserepair -url http://intranet -databasename MyIntranet_Site3. Delete the Orphan Records
stsadm -o databaserepair -url http://intranet -databasename MyIntranet_Site -deletecorruption4. Check the Orphan Records
stsadm -o databaserepair -url http://intranet -databasename MyIntranet_Site
5. PreScan Tool
prescan.exe /c preupgradescanconfig.xml /v http://intranet

Content Database Migration
1. Go to SQL Server and create the website’s Content Database's backup after making it read only.
2. Copy the database's backup file to the New Server.
3. Create a new Database in New SQL Server and Restore the database (overwrite).

Create the MOSS 2007 Website
1. Create the WebApplication in MOSS 2007. Don’t create any site collection.
2. Remove the content application database
stsadm.exe -o deletecontentdb -databasename WSS_Content_Intranet_80 -url http://newintranetsite/
3. Attach the new database
stsadm.exe -o addcontentdb -url http://newintranetsitet/ –databasename Portal_Site_Restore

Ref 1: http://farhanfaiz.wordpress.com/2008/05/23/sharepoint-upgrade-database-migration
Ref 2: http://sharemypoint.blogspot.com/2007/04/prescanexe-finished-with-failure.html

Official SharePoint Documentation

I have recently contributed to the official SharePoint documentation for developement. Check it out here: https://docs.microsoft.com/en-us...