5 Upgrading Private Automation Hub

The following chapter provides information about upgrading Private Automation Hub.

Upgrading 2.2 to 2.3 on Oracle Linux 8

To upgrade Private Automation Hub from 2.2 to 2.3 on Oracle Linux 8, do the following:
  1. Consider performing an OS backup. Backing up a system is good practice so that the system can be restored to its former state if the upgrade fails.
  2. Create a backup of Private Automation Hub. For more information, see Backing up and Restoring Private Automation Hub.

  3. On the system running Private Automation Hub, stop all the Private Automation Hub services:
    sudo systemctl stop pulpcore
  4. Check the status to ensure all services are stopped:
    sudo systemctl status pulpcore* -all
  5. On the local or remote database host, log in to the user account that controls the database.
    sudo su - postgres
  6. Verify which version of postgresql is running.
    rpm -q postgresql
    For example, the following response shows postgresql version 13:
    postgresql-13.20-1.module+el8.10.0+90526+050ec11b.x86_64
  7. Export the database. Exporting the database creates a script file containing all the necessary SQL commands and input data to restore the databases. For example, this command creates the hub.dump file in the database home directory:
    pg_dumpall > /var/tmp/hub.dump
  8. Exit the database user account:
    exit
  9. Stop the database server:
    sudo systemctl stop postgresql
  10. Remove ( and optionally backup ) existing database data directory. For example, the following command removes and creates a backup file in the home directory:
    sudo mv /var/lib/pgsql/data/ ~/data.old
  11. Remove the current version of the database:
    sudo dnf remove postgresql
  12. Install the Postgresql 16 database as described in Setting Up a Remote Database and follow the procedure up to and including the step to restart the database and return to this step but ignore steps 9 to 11 create user and database pulp as these objects are already in the dump file.
  13. After the update completes, set up the database by importing the hub.dump file. Run the following commands:
    sudo su - postgres
    psql -d postgres -f /var/tmp/hub.dump
    exit 
  14. On the Private Automation Hub server, restart the Private Automation Hub service:
    sudo systemctl start pulpcore* -all
  15. Test the Private Automation Hub functionality to ensure everything is working as expected.
  16. Shutdown Private Automation Hub server.
    sudo systemctl stop pulpcore
    sudo systemctl status pulpcore* -all
  17. On the Private Automation Hub deployment host, run the following commands:
    sudo dnf update oraclelinux-automation-manager-release-el8-2.3
    sudo mv /etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo /etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo.OLD
    sudo mv /etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo.rpmnew /etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo
    sudo dnf update
  18. On the Private Automation Hub server, run the collect static command:
    sudo PULP_SETTINGS=/etc/pulp/settings.py /usr/bin/pulpcore-manager collectstatic --clear --noinput
  19. On the deployment host, run the installer for Private Automation Hub with the same user account originally used to install Private Automation Hub.
    ansible-playbook -i hosts single-node-install.yml -e "olpah_admin_password=<admin_password> olpah_db_password=<db_password>"

    Note:

    If you used a parameters file when you first created the server, you must use it again when running this command. For example, add the following to the end of the command line -e "@single-node-vars.yml".

Upgrading Builder Utility 2.2 to 2.3

To upgrade Private Automation Hub Builder utility from 2.2 to 2.3, do the following:
  1. On the host you installed the previous version of the Builder utility, run the following commands:
    sudo dnf install oraclelinux-automation-manager-release-el8-2.3
    sudo mv /etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo /etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo.OLD
    sudo mv /etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo.rpmnew /etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo
    sudo dnf update python3.11-ansible-builder
  2. Update any execution-environment.yml files to the 2.3 images of olam-ee and olam-builder. For example, find the following entries:
    base_image:
    name: container-registry.oracle.com/oracle_linux_automation_manager/olam-ee:2.2
    builder_image:
    name: container-registry.oracle.com/oracle_linux_automation_manager/olam-builder:2.2
    Do one of the following:
    • If you are creating images with Oracle Linux 8, change 2.2 to 2.3-ol8:
      images:
      base_image:
      name: container-registry.oracle.com/oracle_linux_automation_manager/olam-ee:2.3-ol8
      builder_image:
      name: container-registry.oracle.com/oracle_linux_automation_manager/olam-builder:2.3-ol8
    • If you are creating images with Oracle Linux 9, change 2.2 to 2.3-ol9:
      images:
      base_image:
      name: container-registry.oracle.com/oracle_linux_automation_manager/olam-ee:2.3-ol9
      builder_image:
      name: container-registry.oracle.com/oracle_linux_automation_manager/olam-builder:2.3-ol9
  3. If using Private Automation Hub to store olam-ee or olam-builder images then update the images to 2.3 and point the images in execution-environment.yml to the new 2.3 images.
  4. Ensure that any execution environments created in previous releases that are intended to be used in 2.3 are evaluated for changing dependencies. For example, if previous execution environments were created using older versions of ansible-core, confirm that collections or modules used in these older execution environments continue to function with later versions of ansible-core running on Oracle Linux Automation Manager 2.3 nodes.