Copying/Moving SharePoint 2010 Designer Workflows

In man occasions you would be faced by the need to move workflows you developed using SharePoint designer from one site to another. This might be the case if for example you developed and tested the workflow on a testing environment and now wants to move to the production environment without the need to re-develop the workflow.
The steps to perform this is rather simple:
  1. Export the workflow to Visio.
  2. Edit the VWI archive and delete the configuration file.
  3. Import the workflow back to your destination site.
So open the SharePoint designer and open the source site. click on the workflows link on the left and then the workflow you want to move. Click on the ribbon on export to Visio button.
image
Now rename the file exported (VWI file) to be a ZIP file and open it with Windows Explorer. You will find a file named “workflow.xoml.wfconfig.xml”
image
Just delete this file. Now rename the archive back to be a VWI file.
Now open the destination site and click the import from Visio and browse to the edited VWI file. This will allow you to re-associate your workflow as if it was created or exported from Visio rather than the designer while preserving any development made in the workflow it self.
--------------------------------------------------------------------------------------------------------------------
Most often, we required moving or copying a workflow that is created using SharePoint designer between sites or site collections. This was straight forward in SharePoint Designer 2007. You just need to copy the content of the workflow’s config(workflow.xoml.wfconfig.xml) file and the rules file & replaced the list GUID’s. But in SharePoint Designer 2010, there is a little tweak associated with it.
There was an option in SharePoint Designer, Export to Visio which exports your workflow as a .vwi file, and can be imported in to another site using the option Import from Visio.  But when you try that option, you will get the below message.
This workflow cannot be imported because it was created in SharePoint Designer for a different site, or the original workflow has been moved or deleted. To move a workflow between sites, use Save as Template (.wsp file) instead of a Visio workflow drawing.
So, to achieve the same follow the steps below.
  1.  In the first(source) site, create the required workflow and publish it.
  2. Now select Export to Visio option which allows you to save the workflow with a .vwi extension. (Refer this workflow hereafter as source workflow).
  3. Now go to the destination site where you want the workflow to be copied, and create a new workflow with the same name as the previous one & publish it.
  4. Now select Export to Visio option which allows you to save the workflow with a .vwi extension. (Refer this workflow hereafter as Destination workflow).
  5. Now you will be having two .vwi files (one of source workflow’s – SourceWorkflowName.vwi  and other of the destination workflow’s – DestinationWorkflowName.vwi). Now add .zip extension to both the files. Now your files names should be SourceWorkflowName.vwi.zip & DestinationWorkflowName.vwi.zip.
  6. Now open both the zip files, copy workflow.xoml.wfconfig.xml from destination workflow to source workflow. (Its destination to source and not source to destination).
  7. From now on, we will not use the file DestinationWorkflowName.vwi.zip.  So ignore that file.
  8. Remove the .zip extension from SourceWorkflowName.vwi.zip which gives you the   SourceWorkflowName.vwi file.
  9. Now, go to the destination site, open workflows and click Import from Visio and browse to the SourceWorkflowName.vwi file.
  10. That’s it and your workflow is copied. You can publish the workflow and run it.
PS : In case if your list’s GUID’s (for those lists that you have used in workflow – tasks list, history list or any other lists used in workflow steps) have been changed from source & destination site, you may need to update those steps in the workflow.

Comments

Popular posts from this blog

SharePoint 2016 and 2019 Ports

Clear fields based on drop-down values in PowerApps

Hide a SharePoint list field based on user group using JQuery Webservice in 2010