Step 1: Perform a dump on the 5.3.0 VM.
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
xxxxxxxxxxchmod +x migrate_postgres.sh(d) Declare environment variables
xxxxxxxxxxsource /opt/infoworks/bin/env.sh(e) Run the script with the -d flag.
xxxxxxxxxxinfoworks@vm-postgres:~$ ./migrate_postgres.sh -dTaking Dump of Postgrespg_dump installation not found trying in ${IW_HOME}/resources/postgres/pgsql/bin/pg_dumpTaking Postgres Dump - Enter the Parameters of the source PostgresDB ServerInput Postgres DNS / IP connection string for pg_dump127.0.0.1Input the Postgres Port for pg_dump. default: 5432 3008Input postgresDB Username for pg_dump infoworks-userInput the Postgres user password for pg_dump Input the database name of Postgres for pg_dump. default: airflow airflowThis 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.
psql 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
xxxxxxxxxxchmod +x migrate_postgres.sh(e) Ensure the PostgresDB is empty before the following:
(f) Run the script with the -r flag.
xxxxxxxxxxinfoworks@bastion-host:~$ ./migrate_postgres.sh -rRestoring Dump of PostgresRestoring - Enter the Parameters of the target PostgresDB ServerInput Postgres DNS / IP connection string for pg_restore postgres-paas.postgres.database.azure.comInput the Postgres Port for pg_restore. default: 5432 5432Input postgresDB Username for pg_restore infoworksInput the Postgres user password for pg_restore Input the database name of Postgres for pg_restore. default: airflow upgrade_airflowThis restores the Postgres Data.
Step 4: Restore the dags data from the Bastion host (any VM with access to the Kubernetes API)
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.
xxxxxxxxxxmkdir dagstar xzf dags.tar.gz -C dags(d) Get the list of pods on the Kubernetes deployment.
xxxxxxxxxxkubectl -n <namespace> get pods(e) Use Kubectl command cp to copy the dag files to the PVC.
xxxxxxxxxxkubectl -n <namespace> cp dags/*.py <orchestrator-pod-name>:/opt/infoworks/orchestrator-engine/dags/.This copies the dags files to orchestrator PVC.