Octopus Variable export


We are currently using the Octopus Deploy version 3.11.16. We want to get the list of variables( apprx: 600) from 6 variable buckets and compare the deviation from each other. All the buckets have 90% of same copy of variables in it. But we want to determine the 10% deviation and want to merge all the changes so that all the buckets have same copy of variables but may have different values in each of their buckets. So I want to export the variable data to a spreadsheet(each bucket to one file) and use a text comparing tool to determine the changes. Once my comparison is done I want to import the data onto the variable bucket with its values and environment scoping. So I wanted to understand the export and import of the variable set from the Octopus Deploy. your help will be appreciated.



Thanks for getting in touch.

First, I would like to suggest you consider using Library Variable Sets, which will allow you to share variables between projects. If you do have a number of “shared” variables, this is the best way to ensure that there is a single source of truth for these variables.

If you still want to import/export your variable sets, then you will need to script this yourself using the Octopus Api. This will allow you to get your variables in a JSON format. Here is an example script that involves getting a variable set from the API, and also updating a variable. This could make a good starting point for your own script.

You can make this process even easier if you upgrade to v4, where we have introduced a way of exporting a variable set to JSON from within the UI. However, the import process will still need to be scripted.

Hope that helps,