Tuesday, July 9, 2013

SharePoint list migration

There are many ways in which you can migrate SharePoint lists between sites or servers. One of my favorite is by using gl-exportlist and gl-importlist commands created by Gary Lapointe.

With this commands, you can easily export all list items and settings (users and groups) and import them afterwards on a different SharePoint list. 

Follow these steps for list export-import:

1. Start Command Prompt (with "Run as administrator")

2. Write following command to position to right location:



cd "c:\Program Files\common files\microsoft shared\web server extensions\14\bin"


NOTE: In this path, number 14 (marked in red) is for SharePoint 2010. If you are working with SharePoint 2007, then you need to write number 12 instead of 14 in that path. If you are working with SharePoint 2013, then you write number 15 instead of 14 in that path.


3. EXPORT - Write following command to begin export of data: 


.\stsadm -o gl-exportlist -url "http://yourServerName/yourSiteName/yourListName/Forms/AllItems.aspx" -filename "c:\MyDocs" -includeusersecurity -versions 4 -nofilecompression


NOTE: "c:\MyDocs" is a folder on a local disk. If it doesn't exist, it will be created automatically. In the url "http://yourServerName/yourSiteName/yourListName/Forms/AllItems.aspx" you should put the correct url to existing view of your list (put correct server name, site name and list name.

If data has been exported successfully, you'll see screen similar to this one:


And all data is now located on the local disk in the *.dat files.


4. IMPORT - Write following command to begin import of data into another place:

.\stsadm -o gl-importlist -url "http://yourServerName/yourSiteName/" -filename "c:\MyDocs" -includeusersecurity -updateversions 2 -nofilecompression -retargetlinks -sourceurl "http://yourServerName/yourSiteName/yourListName/Forms/AllItems.aspx"


 If data has been imported correctly, you'll see screen similar to this one:

 


More info on these commands:
http://blog.falchionconsulting.com/index.php/2007/09/importexportcopy-lists/


No comments:

Post a Comment