I had to move a couple of SharePoint Designer Workflows from one farm to another. Because they were stored in a site collection, which also needed to be moved, I decided to use PowerShell to move everything at once.
The SharePoint Workflows did not work after the transition. But why?
Because workflows don't know that they were moved. So now we have to work a bit of xml magic and everything will be fine!
1. Open SharePoint Designer
2. Open your web
3. Click on "All Files"
4. Click on "Workflows"
5. Click on the workflow you want to edit
6. Right-click the *.xoml.wfconfig.xml
7. Open with "SharePoint Designer (Open as xml)
8. Edit the fields marked in the screen shot.
DocLibID:
Use this script to get the ID:
$web = Get-SPWeb http://THEWEB
$DocLib = $web.Lists["Workflows"]
$DocLib.id
ListID:
This is the List where the workflow is supposed to be running.
TaskListID:
Usually it's called "Workflow Tasks" or "WorkflowTasks" and will be visible after you activated "SharePoint Server Publishing Infrastructure". Open the list and copy the ID from the address bar or use PowerShell.
HistoryListID:
Usually it's called "Workflow History". You can see the list title when trying to add a new workflow: http://YOURSITE/_layouts/AddWrkfl.aspx. Open the list and copy the ID from the address bar or use PowerShell.