Advise on Upgrading Octopus to the latest LTS version

Hi Octopus Team, Octopus Community!

I’d like ask for your advice on upgrading Octopus.

I am planning to upgrade Octopus v2018.1.0 to the latest LTS version. AFAIK the upgrade of Tentacles (we have around 300) is required.

I cannot upgrade Tentacles via portal, cause Tentacle is installed in custom location. AFAIK it is not possible to change the installation path when upgrading via portal – Am I right?

The best solution for us would be to update them prior to the upgrade of Octopus Server. Is using new version of Tentacle (v4) with Octopus v2018 possible?

Our setup is quite complex, cause currently we have 2 different versions of Tentacles running on each server (I had to keep old Tentacle that is used to connect to Octopus Deploy v2). I know that installation via msi will overwrite the ‘path to executable’ for Tentacle services – which is fine, cause the old Octopus v2 is under decommissioning process .

Also, I’d like to lock the current version of Tentacle on portal, making sure that other people cannot upgrade them. Are you aware of a script that lock the version for all deployment targets via API? I can try to create it by myself, however I am more that sure (octopus has a great community!) that someone has probably created it already :blush:

Your help would be much appreciated. Thanks!

I found the script for the Upgrade Lock:

however I am getting the following error:

Line 58 You cannot call a method on a null-valued expression. Looks like $machine in line 57 is null. Do you know maybe how to fix it?

Hi @pasazer13 ,

Thanks for getting in touch! When upgrading your Octopus server version to 2019+ (Our spaces build), your old Tentacles will still be able to connect fine, so long as you are only using the default space.

If you need to create additional spaces, our older Tentacle versions do not know how to handle this and will give you some errors. However, using a new version of Tentacle with our Pre-spaces build will work fine.

I just made up a quick script which is quite simplistic, but gets the job done. Any target with Tentacle in Octopus will have the value for TentacleVersionDetails.UpgradeLocked set to 1(True) or 0(False). I initially tested this script with True/False but encountered issues. This will give you some errors if the machine it hits does not have a Tentacle (Offline targets, etc), but will continue until all your Tentacles are locked.

cd C:\MyScripts\Octopus.Client
Add-Type -Path 'Octopus.Client.dll' 

$apikey = 'API-KEY' # Get this from your profile
$octopusURI = 'http://OctopusServer' # Your server address

$endpoint = New-Object Octopus.Client.OctopusServerEndpoint $octopusURI,$apikey 
$repository = New-Object Octopus.Client.OctopusRepository $endpoint

$machines = $repository.Machines.GetAll()

foreach ($target in $machines){
    $target.Endpoint.TentacleVersionDetails.UpgradeLocked = 0
    $repository.machines.Modify($target)
    }
1 Like

Hi @pasazer13,

I hit the send button while formatting my script here and sent an initial bad script, so you may get an email with an unfinished response. The one you see above has been edited and should work.

I suggest using the Octopus.Client over direct REST as it is much easier and neater to work with.

If you have any questions on this, or if I have missed anything, please let me know.

Best regards,
Daniel

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.