Archive
The Archive operation copies SharePoint list items (both forms and documents) from a process-controlled SharePoint list to other SharePoint document libraries, or to the local file system. The archive operation can copy the associated workflow data to the archived form view or to a SharePoint column that you specify. You also have the option to delete the underlying SharePoint items as well as to delete the associated workflow data after the archive operation is complete. You can specify the items to archive either by modified date for form items or for a specified number of versions for documents.
The following items will never be archived:
The following table gives the list of keys and descriptions for the –o archive operation.
Name |
Description |
Default |
Required |
|
createcolumns or createfields |
If specified, the operation will create all source columns or fields in the destination automatically. |
No |
No |
|
date |
All items whose modified date is before this date will be archived. |
|
One of the date arguments, days, or versions |
|
days |
All items whose modified date is prior to today’s date minus the specified number of days will be archived. |
|
One of the date arguments, days, or versions |
|
deleteitem |
If this option is specified, the underlying SharePoint item will be deleted. If this option is not specified, the SharePoint item will not be deleted. |
No |
No |
|
deleteworkflow |
If this option if specified, the associated workflow(s) for the item will be deleted. If this option is not specified, the workflows are retained. |
No |
No |
|
destfolder |
The name of the file system folder into which to place the archived items. |
|
No |
|
destlist |
The name of the list that will receive the archived items. For document workflows, the destination must be a regular SharePoint document library. For form workflows, the destination list can be either a document library or a custom list:
|
|
Yes |
|
desturl |
The URL of the site containing the SharePoint list that will receive the archived items. |
|
Yes |
|
enddate |
The last date to archive. |
|
One of the date arguments, days, or versions |
|
includerunning |
Archives items that have processes running against them. |
No |
No |
|
list |
The name of the list to archive. This list must be either a Winshuttle Workflow list or library. |
|
Yes |
|
startdate |
The date to begin archiving. |
|
One of the date arguments, days, or versions |
|
url |
The URL of the Workflow site that contains the list to be archived. |
|
Yes |
|
versions |
The number of versions of a document to archive. Note that these are Workflow versions only. Intermediate versions of documents are not archived. |
|
One of the date, arguments, days, or versions |
|
workflowcolumn |
The name of the column to use in the destination list into which to place a textual description of the workflow data associated with the item. This column must have a data type of multi-line text. |
|
No |
The following example shows you how to copy all documents that have not been modified for at least 180 days from the site http://spserver/documents in the list Process Controlled Shared Documents to the site http://spserver/archive and list Quality Archive. It will automatically create any user-defined columns that exist in Process Controlled Shared Documents that do not exist in the Quality Archive, and then copy the values of those columns. It will also copy a textual representation of the workflow to the column named Workflow Data in Quality Archive, and then delete both the document and the workflow in the source library.
You can use -createfields and -createcolumns interchangeably.
Note: To use the following example, you must type the code. If you copy and paste the example, it will not run.
svadm.exe –o archive –url http://spserver/documents (http://spserver/documents) -list "Process Controlled Shared Documents" –desturl http://spserver/archive –destlist "Quality Archive" -days 180 –createfields -workflowcolumn "Workflow Data" -deleteitem -deleteworkflow