# Migrating from LTS1 to LTS2

With LTS2, it is necessary to migrate existing management server environments running on VMs to be able to run as a management cluster. The following steps walk through that process.

### **Download and Install new Airctl packages.**

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

```bash
./download.sh v-5.6.0-xxxx
./install.sh v-5.6.0-xxxx
```

{% endtab %}
{% endtabs %}

### **Run Pre-Checks**

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

```bash
/opt/pf9/airctl/airctl migrate-pre-checks --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endtab %}
{% endtabs %}

**Backup Management Server**

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

```bash
/opt/pf9/airctl/airctl backup --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endtab %}
{% endtabs %}

Ensure that the backup generated has the mongo and mysql data.

### **Stop and delete** **Management Server**

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

```bash
/opt/pf9/airctl/airctl stop --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endtab %}
{% endtabs %}

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

```bash
/opt/pf9/airctl/airctl unconfigure-du --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endtab %}
{% endtabs %}

**Update Airctl config to use new** **Management Server** **values**

Specifically, the following fields need to be set in\*\*\`\`\`\`/opt/pf9/airctl/conf/airctl-config.yaml:\`\`\*\*

{% tabs %} {% tab language="yaml" title="YAML" %} {% code %}

```yaml
installDriver: DDU

kubeCfgPath: /etc/nodelet/airctl-mgmt/certs/admin.kubeconfig
bootstrapCfgPath: /etc/nodelet/airctl-mgmt/airctl-mgmt.yaml
svcDeploymentTimeout: 600
storageProvider: hostpath-provisioner
externalIP: <external-ip>
privateRegistryType: DU
```

{% endcode %} {% endtab %} {% endtabs %}

The externalIP needs to be a VIP on the same L2 network as the nodelet host(s), but different from the nodelet host's IP.

### **Nodelet Prerequisites**

Uninstall docker

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
yum remove docker-ce containerd
```

{% endcode %} {% endtab %} {% endtabs %}

Install libcgroup-tools

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
yum install libcgroup-tools
```

{% endcode %} {% endtab %} {% endtabs %}

**Deploy nodelet cluster**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
/opt/pf9/airctl/airctl advanced-ddu create-mgmt --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endcode %} {% endtab %} {% endtabs %}

**Initialize airctl**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
/opt/pf9/airctl/airctl init --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endcode %} {% endtab %} {% endtabs %}

**Deploy** **Management Cluster**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
/opt/pf9/airctl/airctl start --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endcode %} {% endtab %} {% endtabs %}

Wait for **Management Cluster** services to be up

The `airctl status` command reports the state of the Management Server. Wait until the status command reports the task state as `ready`.

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
[centos@airctl-host ~]$ /opt/pf9/airctl/airctl --config /opt/pf9/airctl/conf/airctl-config.yaml status
------------- deployment details ---------------
fqdn:                airctl-1.pf9.localnet
cluster:             airctl-1.pf9.localnet
task state:          ready
-------- region service status ----------
task state:        ready
desired services:  42
ready services:    42
```

{% endcode %} {% endtab %} {% endtabs %}

**Migrate** **Management Server** **data to** **Management Cluster**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
/opt/pf9/airctl/airctl migrate --backup-file <tar.gz-of-cdu-backup> --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endcode %} {% endtab %} {% endtabs %}

**Same version upgrade of** **Management Server**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
/opt/pf9/airctl/airctl upgrade --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endcode %} {% endtab %} {% endtabs %}

**Wait for** **Management Server** **services to be up**

The `airctl status` command reports the state of the Management Server. Wait until the status command reports the task state as `ready`.

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
[centos@airctl-host ~]$ /opt/pf9/airctl/airctl --config /opt/pf9/airctl/conf/airctl-config.yaml status
------------- deployment details ---------------
fqdn:                airctl-1.pf9.localnet
cluster:             airctl-1.pf9.localnet
task state:          ready
-------- region service status ----------
task state:        ready
desired services:  42
ready services:    42
```

{% endcode %} {% endtab %} {% endtabs %}

**Configure PMK hosts to work with** **Management Cluster**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
/opt/pf9/airctl/airctl configure-hosts --reset-pf9-managed-docker-conf --skip-docker-img-import --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endcode %} {% endtab %} {% endtabs %}

**Upgrade PMK hosts to new components of** **Management Cluster**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
/opt/pf9/airctl/airctl upgrade-hosts --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endcode %} {% endtab %} {% endtabs %}

**Wait for Task State to report Ready again**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
[centos@airctl-host ~]$ /opt/pf9/airctl/airctl --config /opt/pf9/airctl/conf/airctl-config.yaml status
------------- deployment details ---------------
fqdn:                airctl-1.pf9.localnet
cluster:             airctl-1.pf9.localnet
task state:          ready
-------- region service status ----------
task state:        ready
desired services:  42
ready services:    42
```

{% endcode %} {% endtab %} {% endtabs %}

**Migrate previous clusters to run on** **Management Cluster**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
/opt/pf9/airctl/airctl migrate-clusters --config /opt/pf9/airctl/conf/airctl-config.yaml
```

{% endcode %} {% endtab %} {% endtabs %}

**Push Docker images to** **Management Cluster** **docker registry**

{% tabs %} {% tab language="bash" title="Bash" %} {% code %}

```bash
sudo /opt/pf9/airctl/airctl --config /opt/pf9/airctl/conf/airctl-config.yaml advanced-du push-images --img-tar /opt/pf9/airctl/imgs/docker-imgs-<airctl-release-version>.tar.gz
```
