Rolling back to the previous version of the database

Last Updated : Sep 29, 2020 |
Prolog information
Use this procedure to roll back the Avaya Analytics™ database if an upgrade fails.
Other:
Do not restore a database backup that was taken at an earlier patch level to the current database.
Before you begin
  • Roll back the software.
  • Roll back the custom reports.
  1. Log in to the Cluster Control Manager (CCM) console as the customer user.
  2. Copy the backup of the database taken before running the upgrade to CCM.
  3. To remove the postgres user access to the database, do the following:
    1. As the root user, run the following command:
      ADDITIONAL INFORMATION:
      kubectl exec -it crunchy-primary-service-orca-dbmgr-0 -- //bin/bash
    2. To open a connection to the PostgreSQL command line tool, run the following command:
      ADDITIONAL INFORMATION:
      psql
    3. Run the following command:
      ADDITIONAL INFORMATION:
      REVOKE CONNECT ON DATABASE analytics_db FROM PUBLIC, postgres;
  4. To end the database connections, do the following:
    1. If you are not connected to the crunchy pod, switch to root user and run the following command:
      ADDITIONAL INFORMATION:
      kubectl exec -it crunchy-primary-service-orca-dbmgr-0 -- //bin/bash
    2. To open a connection to the PostgreSQL command line tool, run the following command:
      ADDITIONAL INFORMATION:
      psql
    3. To disconnect from the PostgreSQL database, run the following command:
      ADDITIONAL INFORMATION:
      SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'analytics_db' AND pid <> pg_backend_pid()
  5. To drop the database, do the following:
    1. As the root user, run the following command:
      ADDITIONAL INFORMATION:
      kubectl exec -it crunchy-primary-service-orca-dbmgr-0 -- //bin/bash
    2. To open a connection to the PostgreSQL command line tool, run the following command:
      ADDITIONAL INFORMATION:
      psql
    3. Run the following command:
      ADDITIONAL INFORMATION:
      DROP DATABASE "analytics_db";
  6. To restore the database, run the CCM control script command.
  7. Verify that the system is restored to the previous state by completing the post installation tasks.
  8. To take a back up of the database, use the CCM control script.