Upgrade an Infrastructure Management VMDB appliance

Important: Do not run evmserverd if a database is in a partially migrated state.

  1. Create a temporary upgrade directory.

    On the target appliance, create a temporary upgrade directory by running the following commands:

    mkdir /tmp/upgrade
    cd /tmp/upgrade
    
  2. Back up the current appliance database, v2_key, database.yml, and GUID file.

    Important: Some of these substeps in step 2 are only required if you are upgrading from Infrastructure Management 3.5.x and older.

    These steps don't affect the operations of your appliance infrastructure. However, they help ensure that you are able to roll back if required and replicate the network settings.

    1. Find the size of the databases by using the following command. Then, ensure that your volume has enough space for the backup file.

      Important: This step is only required if you are upgrading from Infrastructure Management 3.5.x and older.

      psql -d vmdb_production -c "SELECT pg_size_pretty(pg_database_size('vmdb_production'));"
      
    2. If it’s a multi-region environment, make sure that you removed all subscriptions from the global database appliance.

      Important: This step is only required if you are upgrading from Infrastructure Management 3.5.x and older.

    3. Stop the evmserverd process.

      systemctl stop evmserverd
      
    4. Back up the databases of your appliances in the root directory. Take a snapshot if possible.

      Important: This step is only required if you are upgrading from Infrastructure Management 3.5.x and older.

      pg_dumpall -c --if-exists | gzip > vmdb.pg.gz
      

      Notes:

      • If you changed your postgresql database configuration files, pg_hba.conf, and postgresql.conf, include these files when you back up the v2_key, database.yml, GUID files. These files need to be manually updated to include any changes you made previously.
      • The pg_dumpall command creates a compressed text-based backup. pg_dumpall is a utility for writing out (“dumping”) all PostgreSQL databases of a cluster into one script file. For more information, see pg_dumpall.
      • Running a pg_dumpall command the pg_replication_slots doesn't get copied over causing the slots to become inactive. This action helps to reduce the size of the global database appliance and allows for quicker backup and restore.
      • Even a compressed database backup can be large so consider storing it on a file system with adequate space such as /var/tmp. Review your available file system space by using the df command.
      • You must also provide backup for configuration files such as /var/www/miq/vmdb/certs/v2_key, /var/www/miq/vmdb/config/database.yml, and /var/www/miq/vmdb/GUID.
    5. Back up the following files and make a note of the appliance that each file comes from. This step is to replace the old appliances in the database and for disaster recovery.

      Important: This step is only required if you are upgrading from Infrastructure Management 3.5.x and older.

      Note: The REGION file might not exist.

      • /var/www/miq/vmdb/GUID
      • /var/www/miq/vmdb/REGION
  3. Clear the data directory.

    Important: This step is only required if you are upgrading from Infrastructure Management 3.5.x and older.

    After the database and postgresql are safely backed up, clear the data directory by running the following commands:

    systemctl stop postgresql
    rm -rf $APPLIANCE_PG_DATA
    
  4. Download the IBM Cloud Pak for AIOps - Infrastructure Automation RPM updates image to the upgrade directory.

    For more information about downloading the image, see Passport Advantage part numbers. Download the RPM updates image and copy the image into the temporary upgrade directory.

  5. Create the /root/upgrade directory by running the following commands:

    rm -fr /root/upgrade
    mkdir /root/upgrade
    
  6. Use the scp command to copy the rpm tarball to the appliance server.

    scp ~/Downloads/infrastructure-management-upgrade-18.y-x86_64-20240521161926.tgz root@<appliance_hostname_or_ip>:/root/upgrade
    

    Where <appliance_hostname_or_ip> is the IP address of the appliance or the hostname of the appliance.

    For example, the scp command copies the infrastructure-management-upgrade-18.y-x86_64-20240521161926.tgz rpm tarball to the server using root as the username.

  7. SSH to the appliance or use the VM console to extract the tarball:

    tar -zxvf /root/upgrade/infrastructure-management-upgrade-*.tgz
    
  8. Run the upgrade script:

    /root/upgrade/im-upgrade.sh
    
  9. Remove the temporary upgrade directory:

    rm -rf /tmp/upgrade
    

    The upgrade process is now complete. After appliances are running again, you can configure database replication in your environment. For more information, see Configuring Database Replication and Centralized Administration in the General Configuration guide.