Archive for February, 2009

The Frugal Pod Podcast is officially launched

Posted on February 7th, 2009 in Uncategorized | No Comments »

I’m happy to announce that David Podley and I just launched a new podcast: “The Frugal Pod”. It’s all about personal finance, budgeting, debt reduction and financial planning. We’d love to have you subscribe to the show via iTunes, or you can visit the blog to see show notes and subscribe to the RSS feed. Please listen and let us know what you think. If you leave comments on the blog or send us an email with ideas or questions we will try to address them in future shows. Thanks!

How to move / re-parent a SharePoint Designer workflow

Posted on February 4th, 2009 in Uncategorized | No Comments »

We ran into a situation recently where we needed to port a SharePoint Designer workflow from one library to another one. Fortunately the libraries are identical; one is in a staging environment and the other is in the production environment. While SharePoint Designer doesn’t offer a native way to do this, we came up with a work-around that has been very efficient:

  1. Make sure you’ve got identical settings and columns in both libraries (in our case, staging and production)
  2. Create a “dummy” workflow in the destination library. This is a one-time only step; you just need to have Designer create a set of workflow files that you can modify.
  3. Export the fully developed workflow files from Designer (i.e. our staging files) and save them off to your desktop; you can do this by publishing the files.
  4. Now for the first tedious step: you need to determine what the GUIDs (i.e. globally unique IDs) are for the library and any lookup lists that your workflow references. One approach to this is to go into the settings screen for each list and grab the URL for the “Audience targeting settings.” The value {in braces} at the end of the URL is the GUID for the list / library.
  5. Once you have a list of all the GUIDs it is a matter of searching and replacing. You need to replace the old GUIDs (in our case, the staging GUIDs) with the GUIDs for the new destination (in our case, production). You can use lots of different tools for this; see the notes at the bottom for how we automated it.
  6. Once the files have been updated with the new GUIDs you simply copy the contents of the updated files into the “dummy” workflow files you created in step 2. If you’ve done everything correctly, the workflow will now be properly associated with your new library. Just run the validation wizard, fix any errors that you see, and you’re ready to go.

Since we’re in active development and moving things from staging to production on a frequent basis we needed to automate the search and replace process. Our solution was to create a sed script to handle this and then call the sed script with a batch file. If you’re not familiar with sed, it’s a popular utility in the Unix/Linux world that people use for mass/batch updates of text files. There is good documentation online; if you’re just doing simple searching and replacing there are samples you can copy from. Once the sed script was done we wrote a very simple batch file that updates all of the workflow files in a particular folder. We drop the updated staging files into the folder, double-click the batch file, and then voila! Our newly updated production files are ready to be used.

The total investment in setting all this up was probably 3-4 hours. If you’re just going to move a workflow once it’s probably easiest to simply replace the GUIDs by hand. If you’re in a similar situation to ours and need to repeatedly migrate solutions from one environment into another this technique should save you some time.