Upgrade to 5.3.1 Kubernetes

Prerequisites

  • Ensure the Infoworks VM version is upgraded to 5.3.0. To upgrade the VM to 5.3.0, refer to Upgrade to 5.3.0.

  • Ensure the upgraded VM is running with MongoDB Atlas as the MetaDB. This Atlas Instance must also have connectivity with the Kubernetes Cluster.

  • The local PostgresDB Services should be running.

NOTE If Infoworks upgrade fails, refer to Infoworks Setup Failure in Kubernetes Cluster due to NGINX.

Procedure

Step 1: Perform a dump on the 5.3.0 VM.

NOTE The tar command must be installed on the VM.

(a) SSH to the 5.3.0 VM

(b) Save the migration script as migrate_postgres.sh.

(c) Provide the Execute Permissions

chmod +x migrate_postgres.sh

(d) Declare environment variables

source /opt/infoworks/bin/env.sh

(e) Run the script with the -d flag.

infoworks@vm-postgres:~$ ./migrate_postgres.sh -d Taking Dump of Postgres pg_dump installation not found... trying in ${IW_HOME}/resources/postgres/pgsql/bin/pg_dump Taking Postgres Dump - Enter the Parameters of the source PostgresDB Server Input Postgres DNS / IP connection string for pg_dump 127.0.0.1 Input the Postgres Port for pg_dump. default: 5432 3008 Input postgresDB Username for pg_dump infoworks-user Input the Postgres user password for pg_dump Input the database name of Postgres for pg_dump. default: airflow airflow

This creates two files: pg_dump_data.sql (the PostgresDB Dump Data) and dags.tar.gz (the tar file containing the airflow dags)

Step 2: Deploy Infoworks 5.3.1 on K8s, giving the same MetaDB parameters as the VM and same PostgresDB parameters as provided in the previous step. For more information, refer to Infoworks Installation on Azure Kubernetes Service (AKS).

Step 3: Restore PostGres Data on any VM with connectivity to the PaaS Postgres.

NOTE Thepsql command must be installed on the VM.

(a) SSH to the VM.

(b) SCP the pg_dump_data.sql file to the VM.

(c) Save the migration script as migrate_postgres.sh.

(d) Provide the execute permissions

chmod +x migrate_postgres.sh

(e) Ensure the PostgresDB is empty before the following:

  • If the Database does not exist, ensure the given user has the permissions to create the database.

  • If it already exists, ensure the given user has complete permissions on the database.

(f) Run the script with the -r flag.

infoworks@bastion-host:~$ ./migrate_postgres.sh -r Restoring Dump of Postgres Restoring - Enter the Parameters of the target PostgresDB Server Input Postgres DNS / IP connection string for pg_restore postgres-paas.postgres.database.azure.com Input the Postgres Port for pg_restore. default: 5432 5432 Input postgresDB Username for pg_restore infoworks Input the Postgres user password for pg_restore Input the database name of Postgres for pg_restore. default: airflow upgrade_airflow

This restores the Postgres Data.

Step 4: Restore the dags data from the Bastion host (any VM with access to the Kubernetes API)

NOTE The tar command must be installed on the VM.

(a) SSH to VM.

(b) SCP the dags.tar.gz file onto the VM.

(c) untar the dags files.

mkdir dags tar xzf dags.tar.gz -C dags

(d) Get the list of pods on the Kubernetes deployment.

kubectl -n <namespace> get pods

(e) Use Kubectl command cp to copy the dag files to the PVC.

kubectl -n <namespace> cp dags/*.py <orchestrator-pod-name>:/opt/infoworks/orchestrator-engine/dags/.

This copies the dags files to orchestrator PVC.

  Last updated