# OS Migration for SMCP 5.12

***

## **1. Run step 1-4 from**[ **this document**](https://platform9.com/docs/PEC/upgrade-smcp) **to take the appropriate backup from the cluster, along with etcd backup and cleanup the old cluster**

{% hint style="warning" %}
**RECOMMENDED**

Before cluster destruction, take the backup of ***`/etc/hosts`*** from the nodelet cluster node. Apply the changes once the management cluster is up.
{% endhint %}

* [Backup Current System](https://platform9.com/docs/PEC/upgrade-smcp#1-backup-current-system) : Take a fresh backup of the upgraded SMCP cluster (SMCP 5.12) and store it in a secure location.
* [Take etcd Snapshot](https://platform9.com/docs/PEC/upgrade-smcp#2-take-etcd-snapshot)
* [Destroy Old Cluster](https://platform9.com/docs/PEC/upgrade-smcp#3-destroy-old-cluster)
* [Clean Up Configuration](https://platform9.com/docs/PEC/upgrade-smcp#4-clean-up-configuration)

{% hint style="info" %}
**NOTE**

Take the backup of airctl-config.yaml and nodelet-bootstrap.yaml for references.
{% endhint %}

2. **Follow next two step from the SMCP installation guide to setup nodelet cluster on the the new OS host.**

* [Install Base Artifacts](https://platform9.com/docs/5.12/PEC/installation#install-base-artifacts)
* [Configuration](https://platform9.com/docs/5.12/PEC/installation#configuration)

{% hint style="info" %}
**NOTE**

Ensure the S3 DNS entry *`34.35.69.42 s3-us-west-1.amazonaws.com`* is added to the `nodelet-bootstrap.yaml`. Also, note that the `userImages:` section in the `nodelet-bootstrap.yaml` is not required.
{% endhint %}

{% tabs %}
{% tab title="nodelet-bootstrap.yaml" %}

```yaml
dns:
  corednsHosts:
  - 34.35.69.42 s3-us-west-1.amazonaws.com 
isAirgapped: true
systemImages:
- /opt/pf9/airctl/imgs/kubedu-imgs-v-5.12.1-3802903.tar.gz
- /opt/pf9/airctl/imgs/nodelet-imgs-v-5.12.1-3802903.tar.gz
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**NOTE**

To enable passwordless access to the workload hosts from the DU, update the `~/.ssh/authorized_keys` file on all workload hosts with the public key from the nodelet hosts, if it has been changed
{% endhint %}

**3. Follow step 7-9 from** [**this document** ](https://platform9.com/docs/PEC/upgrade-smcp)**to create management cluster and restore the cluster.**

* [Deploy New Management Cluster](https://platform9.com/docs/PEC/upgrade-smcp#7-deploy-new-management-cluster)
* [Restore from Backup](https://platform9.com/docs/PEC/upgrade-smcp#8-restore-from-backup)
* [Verify DU Status](https://platform9.com/docs/PEC/upgrade-smcp#9-verify-du-status)

{% hint style="info" %}
**NOTE**

If the external IP of the nodelet cluster has changed, we need to update all the attached nodes with the new IP. Run the following command to update the `/etc/hosts` file without performing any package installation:
{% endhint %}

{% tabs %}
{% tab title="Bash" %}

```bash
/opt/pf9/airctl/airctl configure-hosts --skip-docker-img-import --skip-docker-install --skip-yum-repo-install --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endtab %}
{% endtabs %}
