In SP Designer, I copied a globally reusable workflow in order to make it only reusable (not global) so I can save it as a template solution .wsp to move it to another farm. The problem is that the copied workflow (before I save it as a template) has lost the task fom fields and the task form InfoPath rules. Is there a way not to lose these fields and rules ?
Simply copying the workflow definition .xoml file is not enough. Every single time you design a workflow with SharePoint Designer it creates also a new Content Type with a connection to the InfoPath forms too and so on... (to understand exactly what happens you need to have a look at the file system via SPD - this article explains it clearly http://microsoftsharepointandbeyond.blogspot.com/2010/01/exporting-sharepoint-2010-workflow-into.html).
Do publish the workflow and use the Save as Template to export the .wsp. Once you have the solution package you can delete the workflow from the site. Alternatively you could opt for import the solution package into Visual Studio 2010 which gives you the opportunity to make changes to either the form names, content types and even the workflow itself (see here http://www.pascalbonheur.com/2010/01/export-a-sharepoint-designer-workflow-to-visual-studio-in-sharepoint-2010/)
Thanks to Gennady Vanin, who helped me to find a solution.
To reconnect InfoPath form we can use the next approach:
1. Export source files of the form. Open form in InfoPath designer. And because we can't republish it to the different place using wizard (its type is a Workflow form), we should Export source files (from the menu File\Publish) to some folder. After this step we received a set of files, one of which is "manifest.xsf".
2. Close InfoPath designer.
3. Correct URLs in manifest.xsf Open "manifest.xsf" in a text editor. Find all URL related to the first site collection and replace it with new URLs linked to new site collection. Save the file. Hint: If you don't know the URL to publish in new site collection, you can open autogenerated form from it in the same manner (look at URLs in its manifest.xsf).
4. Publish changed form. Open InfoPath designer, open corrected manifest.xsf in it and publish it (by pressing the publish button for example).
5. Hurray! The form is deployed to the new place!
You should repeat this steps for all custom InfoPath task forms in your workflow.
If somebody needs more detailed description, I could add screenshots.