Interview Questions administrator

Best SharePoint administrator Interview Questions and Answers with topic wise:


Recycle Bin | MMS | ManagedVsCrawledProperties |

Wednesday, February 15, 2012

Migrate lists and libraries from sharepoint 2007 to 2010




We can’t directly deploy or move SharePoint 2007 list and libraries into SharePoint 2010. Because SharePoint server 2010 running on ProductVersion4’, but SharePoint 2007 ProductVersion is ‘3’. That’s the reason we can directly deploy or move SharePoint 2007 list and libraries into SharePoint 2010 server.
Four ways to migrate a list from SharePoint 2007 to 2010 manually,
  1. Using List Template
  2. Using Access table.
  3. Using detach data base.
  4. Using power shell.

1) Migrate using list template.
We create a list template in SharePoint 2007 and migrate it to SharePoint 2010, but here we cannot get a list template directly from SharePoint 2007 to SharePoint 2010.  The below are the steps to get a list template from SharePoint 2007 to SharePoint 2010.

Step 1) Rename the original .STP to .CAB.
Step 2) Extract its manifest.xml to a local folder (let’s call it {working folder}).
Step 3) Search for the Product Version element. This should have a value of 3.
Step 4) Change its value to 4.
Step5) Repackage the manifest.xml into a .CAB. I've done this by using makecab.exe in the “C:\Windows\System32” folder.
       Syntax: makecab.exe {working folder}\manifest.xml {working folder}\ {template-name}.cab
E.g. Wrong: makecab.exe D:\SharePoint practice\My Site\ manifest.xml D:\SharePoint practice\My Site\MyList.cab
       Correct: makecab.exe D:\SharePointpractice\MySite\ manifest.xml D:\SharePointpractice\MySite\MyList.cab

Note: Should not leave space between the words (“working folder” path), otherwise you will get “too parameters exception”.
Step 6) Change the generated cabinet's extension from .CAB back to .STP and upload it into the _catalogs/lt

Limitations: If source list has many items (thousands), you might not be able to copy the entire contents of the list.

2) Migrate using an Access table
The second way to migrate a list from 2007 to 2010 is to use Access. Basically, you need to export a MOSS 2007 list to an Access table, and then import to SharePoint 2010:

Step 1) Open source list with Access
Step 2) Select Export a copy of the data to a new database
Step 3) The SharePoint list will now be imported into Access. You can add or modify columns in this mode to select what you need.
Step 4) From Access, select External Data tab in the Ribbon, and select SharePoint List in the Export section. Enter a SharePoint 2010 site address and select OK.

Your result should appear as follows:
You might be wondering if this method also works with a Document Library since the Document Library doesn't have the menu Action -> Open for Access! Yes, of course it does, but for a Document Library, you need to use the similar "Open with Windows Explorer" menu action.
Step 1) Open both Document Libraries with Window Explorer
Step 2) Select all the documents and folders that you need, and select Copy.
Step 3) Paste the data into the destination folder.

Limitations:
Modified Date, Created Date, Modified By, and Created By columns do not retain their values from the source list. You also need to have Microsoft's Access 2010 in order to use this method.

3) Migrate using the detach database method:-
In this method, we will try to migrate using an STSADM command that is supported by SharePoint 2007. All we have to do is use the Export and Import command to migrate a list.
These are steps that we can migrate:
Step 1) Migrate the entire SharePoint site that contains the list to be exported from 2007 to 2010. Through this we can get only web site. We cannot get lists and items.
Migrate a site from SharePoint 2007 to 2010:
                1. Move the needed site to a new Web application.
                2. Copy the content database backup to the SharePoint 2010 SQL server.
                3. Mount that content database to the SharePoint 2010 server.
Before these three steps check
                Backup your content database just to be on the safe side.
                The SharePoint 2007 server must have SharePoint Service Pack 2 installed.
                Run the upgrade check program on your SharePoint 2007 server, stsadm -o        preupgradecheck. Fix any issues reported before moving on to the next step.
Step 2) Once the site has been migrated to SharePoint 2010 server, let's try to move the sample Tasks list. From Central Admin -> Backup, select Restore -> Export a site or list, In the selection drop down box, select the list that you want to move, At this point, you have exported the desired list to a folder on your SharePoint server, and you are now ready to import that List to the correct destination.
Step 3) next, import the Tasks list to your final destination site. SharePoint 2010 does not provide a User Interface in Central Admin for Granular Restore operations; therefore, you have to use PowerShell to accomplish this task.
import-spweb -identity (site name)[http://sp2010/sites/test ] -path(path to store in server where the backup was stored as .cmp) [\\Thomos\shared\tasks.cmp] -IncludeUserSecurity
Step 4) Finally we get that list with data.

4) Migrate a single list from SharePoint 2007 to 2010 using PowerShell
Finally we use Microsoft power shell to import / export the lists. Microsoft has released a version of Windows PowerShell 1.0 that works with SharePoint 2007.
     Run a shell script to export a list to a DAT file
  1. Change this DAT file to CAB, and extract this file so that you can access SystemData.xml in the CAB file, and modify version information there.
  2. Remake the CAB file and change the extension to .CMP.
  3. Use PowerShell in SharePoint 2010 to import the list from the .CMP file.

Step 1) Launch PowerShell and load SharePoint assemblies to the program.
Step 2) Write a script to export a SharePoint 2007 List.
Step 3) After you have run this shell script you will have your export list in the c:\temp\BackupRestoreTemp\ folder as per the script. [We can change this in the script.].
Step 4) Next, all we have to do is change this DAT file to CAB, extract the file so that you can access SystemData.xml in the CAB file, and modify the version information there. Open the SystemData.xml file in a text editor, and change Version="12.0.0.0" to Version="14.0.0.0", and Build="12.0.0.6514" to Version="14.0.4762.1000".
Step 5) You will have to create a new CAB file again after making the changes above. This is sample content to create the CAB.
Step 6) Finally, we can use PowerShell on SharePoint 2010 server and run the Import-spweb to import the list.

Import-spweb -identity (site name)[http://sp2010/sites/test ] -path(path to store in server where the backup was stored as .cmp) [\\Thomos\shared\tasks.cmp] -IncludeUserSecurity

References:

No comments:

Post a Comment