Help Center>Foundation Help

Applies to:

  • Winshuttle Foundation

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 also copy associated workflow data to the archived form view, or to a SharePoint column that you specify. In addition, as part of the archive operation you can delete underlying SharePoint items and/or associated workflow data after an archive operation is complete.

You can also specify the items to archive either by modified date for form items or by providing count of items to be archived or for a specified number of versions for documents (only valid while using "Winshuttle Process Controlled Shared Documents" Library).

Notes:
  • Documents that are checked out (regardless of the archive settings) will never be archived.
  • When running this command to archive Winshuttle Designer forms with attachments added to a non default view, the attachments will not be moved from the Source List to the Destination List.

The archive operation can be used in 1 of 3 different ways:

  • Archive and Delete: Copy an item and its workflow history data from a source to a destination and delete the source item or\and its workflow data in the Winshuttle workflow database. For this operation, you must specify either or both the deleteitem and deleteworkflow parameters.
  • Archive Only: Copy an item and its workflow history data from a source to a destination without deleting the source item and its workflow data in the Winshuttle workflow database. For this operation, do not specify the deleteitem or deleteworkflowparameters. Once archiving is complete, you will be given the path to an xml file that contains the history of the operation. This path can be used in Delete Only Operation (see below).
  • Delete Only: Delete workflow data and\or the source item for which an archive only operation was used. For this operation, you must specify the archivehistoryxml parameter with the deleteitem and\or deleteworkflow parameter.

    Note: After the Delete operation, an XML file will be created with the name Delete_Archive_.xml. If an error occurs while deleting an item, you can look in the Delete_Archive_.xml file for details about the error.

Version Handling

  • If a source library has document versioning enabled, it is recommended that you enable document versioning for the destination library as well. Archiving is done version by version. One extra version will be added in the destination library. This version’s Workflow History column will contain a history of workflows routed on all versions of the document.  Currently only major (not minor) versions are supported.
  • If library is using the Winshuttle Process Controlled Document Library template, only versions created by "Winshuttle" and the current version are included in archiving. With the exception of the current version of a document, any versions created manually by a user or any third party will not be archived.

Recommendations

  • For best results, use a two-step process:
    • Use Archive Only commands and generate the archive .xml file.
    • If there are no issues in the Archive_[date].xml file, run the delete commands using that .xml file.
  • If the source library has "Require documents to be checked out before they can be edited" set to true, it is recommended to do the same in the destination library.
  • If the source list is not of the type "Winshuttle Process Controlled Shared Documents Library" or "Winshuttle Process Controlled Forms List", it is recommended to use the same Library template for both the source and destination.
  • If the source library is of type "Winshuttle Process Controlled Shared Documents Library", then destination library template must be "Document Library".
  • If the source list is of type "Winshuttle Process Controlled Forms List", the destination list must be of the type "Document Library" or "Custom List".
  • If the destination site is on a different web application (but the same farm), change the Person type column to single line of text.
  • Per Microsoft's recommendation, the recommended "recordlimit" parameter value should not exceed 5000.

Usage

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 -deleteworkflow –url http://spserver/documents -list "Process Controlled Shared Documents" –desturl http://spserver/archive –destlist "Quality Archive" -days 180 –createfields -workflowcolumn "Workflow Data" -deleteitem

Archive Only Command examples

C:\Program Files\ShareVis\bin>svadm -o archive -url http://wrk8:3333/central -list "Data Files" -desturl http://wrk8:4000 -destlist "DocLib" -days 19 -workflowcolumn "new"'0' candidates - '0' archived

This example is run on Central Data File Library with 266 files. These files have a modified date of December 23rd, 2013. The day parameter is set to 19, which means all items whose modified date is prior to the current date minus the specified number of days (19 in this case) will be archived.

The following example archives files between specified start and end dates.

C:\Program Files\ShareVis\bin>svadm -o archive -url http://wrk8:3333/central -list "Data Files" -desturl http://wrk8:4000 -destlist "DocLib" -startdate "12/23/2013 4:41:00 PM" -enddate "12/23/2013 4:41:59 PM" -workflowcolumn "new"

Delete Only command examples

C:\Program Files\ShareVis\bin>svadm -o archive -deleteworkflow –archivehistoryxml "c:\Program Files\ShareVis\bin\Archive_20140108145404.xml" –deleteitem

In this example, the archive history XML file that was generated by the Archive command is being used as input for a delete only operation.

-Usecreationdate parameter command example

svadm -o archive -url http://codemachine/central -list "Data Files" -desturl http://codemachine/central -destlist "Destination4" -createfields -startdate "15/01/2014 2:40 AM" -enddate "15/01/2014 2:45 AM" -workflowcolumn workflowdata –usecreationdate

Archive command options

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:

  • Document Library — the source form will be captured as an MHTML file using the form's status view and placed into the document library. If a Process Control is included in the form view, the workflow history will be included in the form. All commonly named SharePoint columns between the source and destination lists will also be copied.
  • Custom List — the commonly named SharePoint columns between the source and destination lists will be copied. An MHTML file will be created using the status view of the form, and attached as a SharePoint attachment to the list item.

 

Yes

desturl

The URL of the site containing the SharePoint list that will receive the archived items.

 

Yes

enddate

The last date to archive. All items with a modified date lies between startdate and enddate will be archived.

 

One of the date arguments, days, or versions.

includerunning

Archives items that have processes running against them. The document(s) for which a process is not completed yet is copied to the destination library. Note that the document's history is not copied, and neither the document or its history are deleted from the source library.

No

No

itemid

(Workflow 10.8 and later)

Option to archive a single item on basis of SharePoint ID.

If both date arguments and ItemID are provided, Itemid is given the highest priority

No

No

list

The name of the list to archive. This list must be either a Winshuttle Workflow list or library.

 

Yes

recordlimit

The number of items in the input range to be archived. The range is provided using the days parameter or startdate and enddate parameters.

Microsoft does not recommend querying more than 5000 items at one time, so this parameter should be set at 5000 or fewer items.

5000

No

startdate

The date to begin archiving. All items with a modified date lies between startdate and enddate will be archived.

 

One of the date arguments, days, or versions.

url

The URL of the Workflow site that contains the list to be archived.

 

Yes

usecreationdate

This forces the archive utility to work according to the “Creation Date” instead of the “Modified Date”.

 

No

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