Moving list items to a new list based on created date
I have a fairly large list (around 20,000 items).  I need to move all items that were created before a specific date to a different list in the same site collection (and keep the items created on or after that date unchanged).  What would be the easiest way to do that without having to touch each item manually? Could I use powershell to do that or is there a different method? Thanks
May 15th, 2015 1:58pm

you can move the list using save list as template in list settings with include content selected and create another list with that template.(refer the link Save list as template)

you can use the below powershell script for deleting the listitem created on or after a specific date. (change the date according to your need)

[void][System.reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

$site
= new-object Microsoft.SharePoint.SPSite("http://sitecollectionURL")
$web
= $site.rootweb
$list
= $web.Lists["Name of the newly created List"]

$caml
='<Where>
        <Geq>
            <FieldRef Name="Created" />
            <Value IncludeTimeValue="TRUE" Type="DateTime">2014-12-31T02:32:20Z</Value>
        </Geq>
    </Where>'


$query
=new-object Microsoft.SharePoint.SPQuery
$query
.Query=$caml | Write-Output

$items
=$list.GetItems($query)
$listItemsTotal
= $items.Count;

for($x=$listItemsTotal-1;$x -ge 0; $x--)
{
        $items
[$x].Delete()
}

$web
.Dispose()
$site
.Dispose()

Free Windows Admin Tool Kit Click here and download it now
May 17th, 2015 2:44am

Hello Kiddna,

Your best bet is powershell script to archive items.

In addition to ramakrishanan, you can also execute powershell on daily basis automatically so you wont  need to to run it manually. To do this create a new windows task on server and specify the time. Here is ref link:

https://sajiviswam.wordpress.com/2011/07/14/scheduling-sharepoint-powershell-scripts-in-windows-server-2008-r2/

Hope it could help

May 18th, 2015 1:47am

You might probably face an issue of list view threshold when following the plan i mention below. If you like you can try ...

I had a few items in my list created on 31 march 2015. I created a view where i set a filter to show items that are created before a certain number of days and i got the items that i was looking for and then moved it via Content and structure. Heres how it goes.

1) Create a new view and set filter as 

Show items only when the following is true:

Show the items when column

Created is less than or equal to:

[Today]-30


2 ) Note i kept - 30 as i wanted items that were created before 30 days from today.

3) Went to content and structure http://siteurl/_layouts/sitemanager.aspx and moved the content to the desired list


Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 2:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics