---
title: "Upgrading from version below 4.2.1.8 to version 4.2.1.13 in Kubernetes environment"
metaTitle: "Upgrading from version below 4.2.1.8 to version 4.2.1.13 in Kubernetes environment"
metaDescription: "Describes how to upgrade from version below 4.2.1.8 to version 4.2.1.13 in Kubernetes Environment"
---

This document describes how to upgrade OpenIAM from the version 4.2.1.8 to newer version 4.2.1.13 with Terraform. To perform the upgrade, follow the steps described below.

1. Commit your local customizations by pulling the respective repository at https://bitbucket.org/openiam/kubernetes-docker-configuration.git.

2. Checkout to RELEASE-4.2.1.13 depending on the version to be updated to.

3. Merge your customizations.

4. Verify that `env.sh` and `terraform.tfvars` contain your customizations.

5. Update `terraform-0.12.21` to `terraform-0.12.31` by running the following commands.

```bash
wget https://releases.hashicorp.com/terraform/0.12.31/terraform_0.12.31_linux_amd64.zip
unzip terraform_0.12.31_linux_amd64.zip
sudo mv terraform /usr/local/bin/terraform
```

6. Run the following command.

```
kubectl delete jobs -all
```

7. Now that you've finished the manual steps, you can redeploy OpenIAM.

```
./setup.sh

terraform init

terraform apply
```

OpenIAM should be successfully updated, but not started yet because there is a need to update RabbitMQ queues, see below.

# RabbitMQ queue types upgrade

In the 4.2.1.9 version of OpenIAM we've updated the RabbitMQ queue types to be resilient for HA. This means that in case your current version of OpenIAM is 4.2.1.8 and lower to operate 4.2.1.13 version you must perform the following manual steps after upgrading. 

1. Switch to the `RELEASE-4.2.1.13` branch of the project, depending on which version you are aiming to upgrade to.
2. Perform the following command.
```
helm delete $(helm list | grep rabbitmq | awk '{print $1}')
```
1. If using Terraform, perform the following.
```
terraform state rm $(terraform state list  | grep rabbitmq | awk '{print $1}')
```
1. Run `./setup.sh`
2. Finally, run
```
terraform init && terraform apply
```
or re-run Helm script.
