0

We have created a List Workflow using SPD and moved the site to another location using Export & Import-SPWeb cmdlets.

Now, we are unable to the workflow on the new site? is that expected behavior? and how to solve this?

1

The issue you are seeing is that your lists in your imported site have all new GUIDs as identifiers. However, your workflows still have references to the old previous list GUIDs from the previous site. To update this, perform the following steps:

  • open site in SharePoint Designer (SPD)
  • click each custom workflow and see if the 'Associated List' is empty.
  • For each one that is empty, do the following steps

    • click the correct list to associate to the workflow in SPD
    • on the SPD list base page, there will be the List ID GUID. Copy this.
    • Click 'All Files' at the bottom of the left hand navigation list
    • Click 'Workflows', click your workflow you are fixing, and finally click the *.wfconfig.xml file.
    • Click 'Edit File', and change the GUID in "Association 'ListID'" to match the GUID you copied earlier (don't worry about task list and history list right now)
    • Save the file and CLOSE OUT SPD....this step is important. Reopen SPD and verify your list is now reassociated correctly (Until you reopen SPD, the association is not re-synced)

    • reopen the workflow via SPD

    • manually set the task list and history list using dropdowns
  • you may also have broken references in the workflow itself

    • click 'edit workflow'
    • if any items are showing up as GUIDS, then you must correct
    • to do this, open the '.xoml' file for your workflow
    • in SPD, right click and select to open as text in SPD
    • replace all existing list guids with their new counterparts (you are performing the same type of old list -> new list guid mapping you did earlier in the .wfconfig.xml file)
    • save file, exit SPD, and reopen SPD
3

Yes it's possible but it can be annoying. You can create a good workflow on List A and an empty workflow on List B. Then open Workflow A in a text editor and copy the code. Open Workflow B in a text editor and paste in the code. You may need to do this on two files.

Now the important part. You need to replace all of the list GUID references in the pasted code. They will reference List A until you replace them. I've done this with a global find and replace. It's not an elegant solution but sometimes it's necessary.

0

You can also use SharePoint Designer. Just open the workflow in text-based designer, press CTRL+A to select everything, copy and paste into a new empty workflow.

Some of your variable references may get damaged on the way, so you may need to edit them, remove and add the variables on all the formulas. Not very convenient I know, I used this with SharePoint online.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.