Cleaning Up Postgres 13 Binaries after Upgrading to 7.9.2 or Above
search cancel

Cleaning Up Postgres 13 Binaries after Upgrading to 7.9.2 or Above

book

Article ID: 441920

calendar_today

Updated On:

Products

Carbon Black EDR

Issue/Introduction

After upgrading the embedded PostgreSQL database from version 13.x to 15.x, legacy data directories and RPM packages from the previous major version will remain on the Carbon Black EDR Server and Unified View and continue consuming significant disk space; even after the new database version is active and operational. It is recommended to remove these legacy components after validating normal server operation.

Environment

  • Carbon Black EDR Server: 7.9.2 and Above
  • Carbon Black EDR Unified View: 7.9.2 or Above

Cause

Upgrade of the PostgreSQL database version 13.x to 15.x as part of the Carbon Black EDR Server and Unified View 7.9.2 release.

Resolution

  1. Confirm the Carbon Black EDR Server or Unified View is fully operational after the upgrade:
    • Standalone Server: 
      /usr/share/cb/cbservice cb-enterprise status
    • Clustered Server: 
      /usr/share/cb/cbcluster status
    • Unified View: 
      /usr/share/cb/cb-unifiedview status
  2. Confirm PostgreSQL 15.x is active and the database is on the correct version 
    sudo -u cb /usr/pgsql-15/bin/psql -p 5002 -d cb -c "SELECT version();"
  3. Confirm the active data directory is PostgreSQL 15 (check the PG_VERSION file)
    cat /var/cb/data/pgsql/PG_VERSION
  4. Verify the old directory still exists (this confirms it is the backup, not the active database): 
    ls -lh /var/cb/data/pgsql.13
  5. Confirm no processes are using the old directory, the output should be blank: 
    lsof /var/cb/data/pgsql.13 2>/dev/null
  6. Once the above checks pass, remove the leftover old directory: 
    rm -rf /var/cb/data/pgsql.13
  7. Remove the obsolete PostgreSQL 13 packages: 
    yum remove 'postgresql13*'