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 Watson 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. Extract the .tgz on the target appliance.

    Run the following commands:

    cd /tmp/upgrade
    tar -zxvf infrastructure-management-upgrade-15.y*.tgz
    
  6. Enable new stream 8 modules.

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

    Enable the stream 8 modules by running the following commands:

    dnf -y module reset postgresql
    dnf -y module enable postgresql:13
    dnf -y module reset ruby
    dnf -y module enable ruby:3.0
    
  7. Upgrade the RPM packages.

    Run the following commands:

    dnf -y upgrade --allowerasing --refresh *.rpm
    dnf -y autoremove
    
  8. Initialize the data directory.

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

    Run the following command:

    appliance_console_cli --internal --standalone --password smartvm
    
  9. Verify that the PostgreSQL version is 13.

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

    Run the following command:

    cat $APPLIANCE_PG_DATA/PG_VERSION
    

    This command checks the PostgreSQL version and returns: 13

  10. Restore the database with postgresql 13.

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

    Run the following command:

    gunzip < <your_backup_file>  | psql postgres
    
  11. Migrate the database and reset the ManageIQ and IBM automate domains.

    Change to the vmdb directory.

    cd /var/www/miq/vmdb/
    

    Run the command appropriate to your environment to migrate everything in the database to work with the latest configuration. If you run into an error, contact IBM Support.

    rake db:migrate
    

    Update the Automate Model to the latest version. This command resets the ManageIQ and IBM domains (base domains) to a new and upgraded version. Run the command appropriate to your environment to update the Automate Model:

    In a single (stand-alone database) or replicated environment, run the following command on each VMDB appliance.

    rake evm:automate:reset
    
  12. Start the evmserverd process.

    In a single (stand-alone database) or replicated environment, run this command on each VMDB appliance:

    systemctl start evmserverd
    
  13. Remove the temporary upgrade directory.

    Remove the upgrade directory by running the following command:

    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.