5 Upgrading Private Automation Hub

The following chapter provides information about upgrading Private Automation Hub.

Upgrading 2.1 to 2.2

To upgrade Private Automation Hub from 2.1 to 2.2, 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 10:
    postgresql-10.23-4.0.1.module+el8.9.0+90164+87901204.x86_64
  7. Do one of the following:
    • If version 13 is installed, go to step 17.
    • If version 10, 11, or 12 is installed, go to the next step.
  8. 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 > hub.dump
  9. Exit the database user account:
    exit
  10. Stop the database server:
    sudo systemctl stop postgresql
  11. 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
  12. Remove the current version of the database:
    sudo dnf remove postgresql
  13. Reinstall the 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.
  14. 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 hub.dump
    exit 
  15. On the Private Automation Hub server, restart the private automation hub service and NGINX processes:
    sudo systemctl start pulpcore* -all
    sudo systemctl start nginx
  16. Test the Private Automation Hub functionality to ensure everything is working as expected.
  17. On the Private Automation Hub server, run the following command:
    sudo dnf install oraclelinux-automation-manager-release-el8-2.2
    sudo dnf config-manager --disable ol_automation2
  18. On the Private Automation Hub deployment server, run the following command:
    sudo dnf install oraclelinux-automation-manager-release-el8-2.2
    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
  19. Update the OS on the Private Automation Hub server and the deployment server:
    sudo dnf update -y --refresh
  20. 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
  21. 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.1 to 2.2

To upgrade Private Automation Hub Builder utility from 2.1 to 2.2, 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.2
    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 python39-ansible-builder
  2. Update any execution-environment.yml files to the 2.2 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:latest
    builder_image:
    name: container-registry.oracle.com/oracle_linux_automation_manager/olam-builder:latest
    And change latest to 2.2:
    images:
    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
  3. If using Private Automation Hub to store olam-ee or olam-builder images then update the images to 2.2 and point the images in execution-environment.yml to the new 2.2 images.
  4. Ensure that any execution environments created in previous releases that are intended to be used in 2.2 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.2 nodes.