The stsadm.exe works well with site migration. However, it does not offer any option to export a list. Therefore to migrate a SharePoint list you need to do the following procedure:
- Create a template from the List you want to export (and include the content in the template), download a copy of the .stp template file created.
- Then upload the stp file to the List Templates Gallery.
- Create the list from the template you have just created.
Have you ever wanted to copy a list that had a lookup field from a source Web to a destination Web using a custom list template (STP)? Even if the destination Web has a lookup list that exactly matches the source Web, the lookup field will be empty in any lists created using the STP. That is because lookup fields are related by GUID.
This is a common problem with custom list templates. The following steps describe the workaround. Assuming that your destination Web already has a lookup list identical to the source Web. Replace [yourlist] with the name of the list you want to move.
- Browse to the source Web's lookup list and choose Modify settings and columns.
- Copy the source lookup list GUID from the URL.
- Browse to the destination Web's lookup list and choose Modify settings and columns.
- Copy the destination lookup list GUID from the URL.
- Save the source Web's list that contains a lookup column to the lookup list as a list template called [yourlist].stp.
- Export the list template STP from the source list template gallery to the file system.
- Rename the [yourlist].stp file to [yourlist].cab so Windows can open it.
- Open the file, right click on the manifest.xml file and export it to the file system.
- Edit the manifest.xml file; find the source Web's lookup list GUID and replace it with the destination Web's lookup list GUID.
- Save the manifest.xml file.
- Open a VS.NET command prompt.
- Run the makecab command as: makecab manifest.xml [yourlist].stp
- Import the new STP into the destination Web's list template gallery. You will need to delete it if it has previously been imported.
- Create a new list based upon the new STP file.
The lookup column on the new list should retain all the data that was in the source list.