How to Move Documents Including Versions in SharePoint 2010 Document Library Using NINTEX Workflow

Introduction

In this article you will see how to move documents including versions in a SharePoint 2010 Document Library using a NINTEX workflow. I have created a Document Library named “Source” in which the workflow is created and the workflow will move the documents including versions to another Document Library named “Destination”. We will move the documents using _vti_bin/_vti_aut/author.dll.

Please refer to: move document Method.

Workflow Design


A Regular Expression (Source URL) action is used to get the source URL of the document.

A Regular Expression (Destination URL) action is used to get the destination URL of the document.

A Web Request action is used to move the documents including versions.

Move Documents workflow

  1. Navigate to the Source Document Library.
  2. Click on the Library tab and then click on Workflow Settings.
  3. Click on Create a Workflow in Nintex Workflow.


     
  4. Click on Cancel.


     
  5. Drag and drop the Regular expression action from the Operations section and rename to Source URL.
  6. Click on Configure from the drop down list in the Regular Expression action.
  7. Click on the Variables button.


     
  8. Click on New button in the ribbon interface.


     
  9. Enter the Name as sourceURL and select Type as Single line of text.


     
  10. Click on Save.
  11. Click on New button in the ribbon interface.
  12. Enter the Name as destinationURL and select Type as Single line of text.


     
  13. Click on Save.
  14. Workflow variables are created successfully to store the URL values. Click on the Close button.


     
  15. Click on the Insert Reference button for the Pattern field. Click on the Common tab and then click on Web URL. Click on OK.


     
  16. Select Replace Text as Operation.
  17. Select Item URL as Input Text by clicking Insert Reference (Select Item URL from Common tab).


     
  18. Select sourceURL variable to store the result.
  19. Click on Save.
  20. Drag and drop the Regular expression action from the Operations section and rename it to Destination URL.
  21. Click on the Configure from the drop down list in the Regular Expression action.
  22. Select the values as shown below.


     
  23. Click on Save.
  24. Drag and drop the Web request action from the Integration section.
  25. Click on Configure from the drop down list in the Web request action.
  26. Click on the Insert Reference button for the URL column and then click on Common tab. Select Web URL and then click on Ok.
  27. Append /_vti_bin/_vti_aut/author.dll in the URL column.
  28. Enter the User Name and Password.
  29. Select POST and enter the Content Type as application/x-www-form-urlencoded.
  30. Add the header – Name: X-Vermeer-Content-Type and Value: application/x-www-form-urlencoded. Select Text and add the following value. Ensure the version is correct.
    method=move+document:14.0.6129.5002&service_name=/&oldUrl={WorkflowVariable:sourceURL}&newUrl={WorkflowVariable:destinationURL}&url_list=[]&rename_option=findbacklinks&put_option=overwrite,migrationsemantics


     
  31. Click on Save.

Publish the workflow

  1. Click on the Publish button in the ribbon interface.


     
  2. Ensure the Title is set; optionally you can set the values for Description and Change Comments.


     
  3. Click on the Submit button.


     
  4. The workflow is published successfully.

Test the workflow

  1. Navigate to the Source Document Library.
  2. Select the document and then click on Version History in the Context menu.


     
  3. You will see all the versions for the document as shown below.


     
  4. Select the document and then click on Workflows in the context menu.
  5. Click on Move Documents workflow.


     
  6. After a few minutes the workflow status will be changed to Completed.
  7. Navigate to the “Destination” Document Library; you will see that the document has been moved successfully including the versions.

Summary

Thus in this article you saw how to move documents including versions in a SharePoint 2010 Document Library using NINTEX workflow.