I have a list in SharePoint 2010 web site with a simple workflow to test the possibility of back-up and restore of the list while retaining the status of work flow.
The list currently has only ID and Title to be kept as simple as possible and the workflow also has only one task in it which sends an email and waits indefinitely after the email. The workflow was written by Visual Studio 2010 based on the State Machine Workflow template.
I used following commands to perform back-up and restoration.
- Export-SPWeb -identity http://
testserver
/sites/AnhamDev -itemurl Lists/Test%20List -path "C:\spbackup\TestList.cmp" -force - Import-SPWeb -identity http://
testserver
/sites/AnhamDev -path "C:\spbackup\TestList.cmp"
I deleted all rows from the list before starting the restoration step. There is no error while running the back-up and restoration and all data were restored successfully.
The problem is that the workflow is always restored as "Completed" after the restoration is finished. Since I designed the workflow waits indefinitely, the workflow status is supposed to be "In Progress" at all times. During the restoration, there are no emails sent out, either and that sort of gives me an impression that the workflow was never run but somehow reached its "Completed" status.
I created the same workflow by Visual Studio 2010 using Sequential Workflow template but the result was the same.
However, when I designed the same workflow using SharePoint Designer 2010, the Workflow was run during the restoration and was restored back to where it was which was "In Progress."
Could anybody tell me why my list can't be properly restored with a workflow designed by Visual Studio 2010?