1

I'm currently moving some SP lists from one site collection to other site collection using list templates(without content).

I followed the process given in this link for moving lists with lookup fields in them.

the excerpt from the link is as follows:

  1. Browse to the source Web’s lookup list and choose Modify settings and columns.

  2. Copy the source lookup list GUID from the URL.

  3. Browse to the destination Web’s lookup list and choose Modify settings and columns.

  4. Copy the destination lookup list GUID from the URL.

  5. Save the source Web’s list that contains a lookup column to the lookup list as a list template called [yourlist].stp.

  6. Export the list template STP from the source list template gallery to the file system.

  7. Rename the [yourlist].stp file to [yourlist].cab so Windows can open it.

  8. Open the file, right click on the manifest.xml file and export it to

the file system.

  1. Edit the manifest.xml file; find the source Web’s lookup list GUID and replace it with the destination Web’s lookup list GUID.

  2. Save the manifest.xml file.

  3. Open a VS.NET command prompt.

  4. Run the makecab command as follows:

    makecab manifest.xml [yourlist].stp

  5. Import the new STP into the destination Web’s list template gallery. You will need to delete it if it has previously been imported.

  6. 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.

The lists got moved successfully for some of them. Some lists have additional lookup columns from parent list. These lists are showing the following error in AllItems.aspx

Sorry, something went wrong

File Not Found.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.

I went to the list settings and edited the view and found that on enabling the additional lookup fields in the view, I'm getting the error.

If I enable only the lookup column without additional lookup fields the view is getting rendered correctly.

How do I resolve this error.? One other list which had additional lookup fields is getting rendered correctly. So I dunno what might be the cause.

Some details about the order in which i created the lists.

First, I created the parent list from template and then created the child lists from the template.

I went to edit column of the lookup fields and found that they're correctly pointing to the parent lookup list.

1

So I don't know what was the cause of the error even though I edited the GUID of all additional lookup fields to reflect the current parent list.

I solved the error though by

  1. Edit the lookup field and remove all additional fields
  2. Edit the same field again and re-enable the additional lookup fields

The solution is not great if you need to include content also in your list as any orphaned child list items (where primary lookup field once existed but later got removed due to some condition based on other fields) in the child list will be deleted on removing additional lookup fields.

If there are any other solutions which doesn't involve disabling and enabling additional lookup field, I'd be grateful to hear them.

UPDATE:

Found a more permanent solution. The problem File Not Found error was mainly because of 2 fields not 1 field as I initially thought.

Whenever a list having lookup field is saved as template, the original parent list GUID is embedded in manifest.xml as List={parent_list_GUID} in the Field attribute of the lookup field.

Also, sometimes the parent site reference is also embedded as WebId="parent_site_GUID".

I found about this piece of information from this link. Many thanks to Andre, the author of that post.

This was the major issue for my error as I was re-creating the list from the template in a different site collection. So the WebId was different and threw that File Not Found Error. I found two solutions for this from the web.

I found in this link that the GUID of the original site collection can be obtained by appending /_api/web to site collection URL and found the GUID there in the REST XML response as

<d: Id m:type="Edm.Guid">some_GUID_here</d:Id>

In the same fashion, found the GUID of the target site collection and did a find & replace in the manifest.xml to overwrite the old WebId with the new one.

The result was, there is no error. :)

I also tried deleting the entire WebId attribute from the manifest.xml and still got the output as expected without any error.

Also from this answer and the link in that answer. I came to know that I can avoid editing the parent list GUID by replacing it with Lists/List Name.

TL;DR

So the steps to resolving the error are

  1. Edit the manifest.xml file inside the .stp and either
  2. Replace the old WebId with the new WebId OR
  3. Remove the WebId attribute
  4. Replace the old list GUID with new list GUID OR
  5. Replace the old list GUID with Lists/List Name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.