Question

I have been working on my site collection on test environment. and now i want to backup the site collection and restore it inside our live server. now the only issue i have faced in this process is how i can remove test items from our lists and reset the item Id to be equal to 1.

now i have a custom list inside our test environment that have the following customizations :-

  1. inside the AllItems.aspx list view and other list views i have edited the page, and i add some script editor web parts.
  2. also for each list view i added an advance search web part https://splistviewfilter.codeplex.com/releases .

so now i tried the following:-

  1. inside the test server i saved the list as template (without content).
  2. Remove the the list.
  3. Create a new list based on the template.

but the result i got is not what i was looking for , for the following main reason:-

  1. on the new list (which i create based on the template) all the customization i did on the list views; such as adding script editors, adding advance search web part have been lost.

so can anyone adivce if there is a more reliable way to reset my list data and keep all the customization i did inside the list views ? as seems saving a list as template will not preserve these kind of customization. so not sure if sharepoint support deleting all the list items, and start the items' index from 1? as it will not be accurate to simply delete all items on live , and then when a user create a new item , its ID will be for example 70 instead of 1!!

Was it helpful?

Solution

You can save the list as a template, then create it where you want. The updates on the list view won't be migrated, so what you can do is:

  • Open the first list in SharePoint Designer, by clicking on Lists and Libraries from the left menu in SharePoint Designer, then choose your list name.
  • From the views menu, choose your view name where you have the webparts added.

enter image description here

  • Your list view will be with the tag: <WebPartPages:XsltListViewWebPart , so you need to ignore it, as you already have the same in the migrated list, you're interested in other webparts, so you should be looking for <WebPartPages:ScriptEditorWebPart for example if you want to migrate the script editor webpart you have.

enter image description here

  • Copy the script editor, and open the migrated list, open the view, and paste it in the same location, and save.

This way you'll start from ID 1 as you have a new list instance, and you will have the wbeparts that were available on the page.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top