Upgrade Instructions - GCP (4.2)

Upgrade Instructions - GCP (4.2)

This section describes the standard upgrade procedure for upgrading Usage Engine on Google Cloud Platform. This procedure should be used to ensure that configurations, persisted data (in the file system or database), and system properties are properly migrated. Workflows will be interrupted shortly at the restart of the ECDs. These instructions will also describe how the timing of the restart of ECDs running non-scalable real-time workflows can be controlled by enabling manual upgrade.

Note!

The instructions for backup and upgrade of the database are only valid for Postgresql as platform database since Oracle and SAP HANA are not supported as hosted databases in GCP. If the platform database used is Derby, the backup of the file store covers the database as well (assuming persistent storage of the platform is enabled).

Backup the database by following these steps:

  1. List the databases and locate the one used for Usage Engine:

    gcloud sql instances list
  2. Perform a backup of the database by running the following command:

    gcloud sql backups create --instance=<database instance name> --location=<region> --description=<optional description of backup>

    For example:

    gcloud sql backups create --instance=usage-engine-system-db --location=europe-north1 --description="Backup before upgrade"

    The next step is to do a backup of the filestore used. If there are standalone ECs that still running and writing to their logs to the same filestore, any events ocurring after the initiation of the backup will not be included in the backup.

  3. List your file stores to get the relevant information for the backup:

    gcloud filestore instances list INSTANCE_NAME LOCATION TIER CAPACITY_GB FILE_SHARE_NAME IP_ADDRESS STATE CREATE_TIME davids-babelfish-filestore europe-north1-a STANDARD 1024 davids_babelfish 10.70.122.178 READY 2024-04-23T09:15:46 davids-stratus-filestore europe-north1-a STANDARD 1024 davids_uepe 10.135.205.218 READY 2024-05-08T13:00:10
  4. Perform a backup of the file stores by running the following command:

    gcloud filestore backups create <backup name> --file-share=<file share name> --region=<file share region> --instance-zone=<location as listed above> --instance=<instance name>

    For example:

    gcloud filestore backups create before-upgrade --file-share=davids_uepe --region=europe-north1 --instance-zone=europe-north1-a --instance=davids-stratus-filestore

    If you need to upgrade the platform database in connection with the Usage Engine upgrade, then this is a good time to do that since the database is already shut down for the backup. First check in the Cloud SQL page in the Google Cloud Console which versions are available, and find what version matches what the Usage Engine Private Edition version you’re upgrading to supports.

Upgrade the database by running the following command (where “POSTGRES_15” is the target version) :

gcloud sql instances patch usage-engine-system-db --database-version=POSTGRES_15

Restore database backup

gcloud sql backups list --instance=davids-stratus-db ID WINDOW_START_TIME ERROR STATUS INSTANCE 1715600153363 2024-05-13T11:35:53.363+00:00 - SUCCESSFUL usage-engine-system-db 1715593317584 2024-05-13T09:41:57.584+00:00 - SUCCESSFUL usage-engine-system-db 1715562000000 2024-05-13T01:00:00.000+00:00 - SUCCESSFUL usage-engine-system-db 1715475600000 2024-05-12T01:00:00.000+00:00 - SUCCESSFUL usage-engine-system-db 1715389200000 2024-05-11T01:00:00.000+00:00 - SUCCESSFUL usage-engine-system-db 1715302800000 2024-05-10T01:00:00.000+00:00 - SUCCESSFUL usage-engine-system-db 1715216400000 2024-05-09T01:00:00.000+00:00 - SUCCESSFUL usage-engine-system-db 1715173571207 2024-05-08T13:06:11.207+00:00 - SUCCESSFUL usage-engine-system-db

And restore:

gcloud sql backups restore 1715562000000 --restore-instance=usage-engine-system-db

Restore filestore

To restore the filestore:

gcloud filestore instances restore <instance name> --file-share=<file-share-name> --zone=<zone> --source-backup=<backup name> --source-backup-region=<backup region>

For example:

gcloud filestore instances restore davids-stratus-filestore --file-share=davids_uepe --zone=europe-north1-a --source-backup=before-upgrade --source-backup-region=europe-north1