I had developed a complex Info Path form with several long
SharePoint workflows associated with it. For various reasons, I needed to copy
the form and the workflows to another SharePoint site belonging to a different
department in my organisation. Copying and publishing the form to the second
site was easy enough, but the workflows did not copy at the same time, of
course. I soon found out that there was no simple copy facility to do this.
However, after a bit of searching, I discovered that it could possibly be done
by exporting and importing again using Microsoft Visio. You don’t actually need
to purchase Visio to do this – all I did was download the free Visio reader
software directly from Microsoft. (You may not even need to do this, but it was
free anyway.)
The suggested solutions involved changing the file
extensions to zip files, opening them and then changing them back again before
copying. However, I couldn’t get it to work – the copied files weren’t being
recognized. However, eventually I found a method that did work – it’s a
combination of a couple of online solutions. I’m no great expert, and some of
the steps might be unnecessary, but it worked for me. Here it is:-
1.
Open your destination SharePoint site using
SharePoint Designer (SPD).
2.
Create a new blank workflow in your destination
site. Give it the same name as the workflow that you wish to copy. (e.g.
xxxxxxxxxx)
3.
Add at least one “Condition” and one “Action” to
the workflow. It doesn’t matter what they are, they will be overwritten later.
I used the condition “created by a specific person” and the action “send an
e-mail”, using my name each time.
4.
Save and publish the workflow. Using the
navigation bar, come out of the editing page and go back to the workflow
information and settings page. Ensure that in the settings, “Task List” is set to “Tasks” and “History
List“ is set to “Workflow History”. Save and publish again.
5.
Go back to the “Workflows” page using the
navigation bar again. Select (don’t open)the workflow you have just created,
and from the top menu bar, click “Export to Visio”, and save it to you desktop
when prompted – it will appear as a .vwi
folder.
6.
Open your source SharePoint site from SPD. You
should now have two SPD folders open – the source where you are copying from,
and the destination where you are copying to. In the source folder, select
“workflows” from the left hand menu as before.
7.
From the list of workflows, select the one you
want to copy, and again “Export to Visio”, this time saving it in a different
location – not the desktop, as it will overwrite the new one. (Bizarrely, this
is actually what you want, but you cannot do it directly!) You will end up with
another .vwi folder.
8.
Change the file extensions on each of these
.vwi folders by adding .zip at the end.
They will both become xxxxxxxxxx.vwi.zip folders. Ignore the warning messages.
9.
Right click on each one in turn, and extract the
zipped files (“Extract All”) You can just store the unpacked folders in the
same locations as the zipped folders. You will see that the file extensions
change back to .vwi but now you can open
them!
10.
In both the unpacked folders you should see four
files:-
[Content_Types].xml
workflow.xoml
workflow.xoml.rules
workflow.xoml.wfconfig.xml
The files you want are workflow.xoml and
workflow.xoml.rules
11.
Copy these two files from the unpacked source
.vwi folder, and paste into the unpacked
.vwi folder on your desktop – the
destination.
12.
Unfortunately, you can’t yet import the modified
.vwi folder back into your destination
workflow. You will notice that although the file extension is correct, the icon
doesn’t look as it did when you exported it in the first place, and Visio won’t
recognize it. You need to zip it again and then rename the file extension as
follows:-
13.
Open the now modified .vmi file saved on your
desktop. You need to re-zip the four files again – select them so they are
highlighted, right click and choose the zip (might be called 7-zip) facility.
From the drop down, select “Add to
xxxxxxxxxx.vwi.zip” (the x’s will be whatever your workflow is called, of
course). You should now have a fifth zipped file.
14.
Re-name the extension of this new zipped file by
simply removing the .zip from the end, and you will get a .vmi file that will be recognizable when
you try to import it using Visio.
15.
Finally, open your destination SPD folder, and
close all the tabs except for the one that lists the workflows. Select
“import rom Visio” from the top menu, browse to your desktop location, and
select the .vmi file from within
the .vmi file. When you click on “open”,
you should get a message warning that you are about to overwrite an existing
workflow – click “finish”, and your copied workflow will appear!
16.
Now save and publish once more, and you’re done.
You can delete all the exported and zipped files saved on your desk top and
other location if you want.
Warning – because you have copied a workflow
from one site to another, you may have to amend some of the individual steps if
they refer to locations in the original site.
However, this is a lot less work than re-writing a complex workflow.
You’ll also have to change how the workflows start – the copied ones will
default to “manual start” only.