Transform tool for transferring TFS 2015.3 Release Templates to VSTS

If you are moving from on-premises TFS to VSTS you might hit the same problem I have just have. The structure of a VSTS releases is changing, there is now the concept of multiple ‘Deployment Steps’ in an environment. This means you can use a number of different agents for a single environment – a good thing.

The downside this that if you export a TFS2015.3 release process and try to import it to VSTS it will fail saying the JSON format is incorrect.

Of course you can get around this with some copy typing, but I am lazy, so….

I have written a quick transform tool that converts the basic structure of the JSON to the new format. You can see the code as Github Gist

It is a command line tool, usage is as follows

  1. In VSTS create a new empty release, and save it

  2. Use the drop down menu on the newly saved release in the release explorer and export the file. This is the template for the new format e.g. template.json

  3. On your old TFS system export the release process in the same way to get your source file e.g. source.json

  4. Run the command line tool providing the name of the template, source and output file

    RMTransform template.json source.json output.json

  5. On VSTS import the newly create JSON file release file.

  6. A release process should be created, but it won’t be possible to save it until you have fixed a few things that are not transferred

    1. Associated each Deployment step with Agent Pool
    2. Set the user accounts who will do the pre-and post approvals
    3. Any secret variable will need to be reentered
      IMPORTANT - Make sure you save the imported process as soon as you can (i.e. straight after fixing anything that is stopping it being saved). If you don't save and start clicking into artifacts or global variable it seems to loose everything and you need to re-import

image

It is not perfect, you might find other issues that need fixing, but it save a load of copy typing