Octo.exe export/import caveat: octo.exe versions matter
After doing numerous migrations using the octo.exe version 184.108.40.206, I decided to upgrade and move to version 220.127.116.11. As always, exporting is a breeze. But the import itself seems to be inconsistent – or at least, that’s what I’ve experienced. And there’s probably a good reason for it: octo.exe versions. When I’m referring to versions for the octo.exe, there are two distinct versions to keep in mind: the octo.exe itself and the servers that are being exported from and imported into.
In our case our Octopus Deploy servers are still using version 2.5.13. That has remained static, but the difference between octo.exe versions seem to have varying levels of success. It’s not surprising but it’s not exactly clear what the solution is. I used 18.104.22.168 to export a project, but was unable to import even though the Octopus Servers were the same version. But, when I reverted back to using 22.214.171.124, the import process worked like a charm. Here’s what the newer (126.96.36.199) version gave me.
When using the previous version 2.6.1, everything worked just fine. Same export file. All the dependencies are there, including the Action Templates (aka Step Templates).
I wouldn’t be surprised if there’s some extra validation that happens during the import process in the newer version, as it probably should. I can’t reproduce this error consistently and rather than hunt down the issue, I simply reverted back to 2.6.1. Luckily, the Octo.exe is open source so you can take a look on GitHub: https://github.com/OctopusDeploy/Octopus-Tools. I found this line to be of interest regarding the error message: https://github.com/OctopusDeploy/Octopus-Tools/blob/master/source/OctopusTools/Importers/ProjectImporter.cs#L352
When you’re exporting/importing projects from different versions of octopus servers there maybe newer features that the old octopus server won’t have available in the json file – thus complicating or getting errors during the import. For us, this is a not an issue. While I want to use the later version with better bells, whistles and validation, a working octo.exe imports trumps a newer version that has errors during importing. We have a lot of projects to migrate and time is a luxury we just don’t have. I’ll chalk this up as a minor pitfall or an addendum to to my octo.exe pitfalls post a while back. If you’re having trouble exporting and importing a project in Octopus using the octo.exe, try out octo.exe version 2.6.1. I’m assuming you’re exporting/importing to Octopus servers with the same major/minor version of course.
Is this a great tip? Meh, for as long as it works – yes. Over time, I expect improvements to the octo.exe that will basically nullify my recommendation in sticking to version 2.6.1 of the octo.exe (or sticking to whatever octo.exe works for your exporting/importing needs). I’ve probably done around 30 projects or so with numerous projects to migrate. This post is really just saying what works for me.