5.1.4 Upgrade to the Latest Enterprise Edition in Docker Swarm

Run these steps to upgrade to the latest release of Transaction Manager for Microservices Enterprise Edition only if you use Oracle Database to store the transaction logs in the previous release. You can run these steps in the Docker Swarm environment.

The MicroTx coordinator runs in the main container. As part of the upgrade process, MicroTx creates an init process in an independent container. The init process starts, completes the prerequisite steps for the upgrade, upgrades the MicroTx coordinator, and then terminates when it finishes the upgrade. It uses the MicroTx image that the main container also uses.

Do not use the instructions in this section in the following scenarios:

To upgrade to Transaction Manager for Microservices 24.2 Enterprise Edition:
  1. Download the files for the latest release of MicroTx. See Download the Installation Bundle.

    Ensure that you do not overwrite the files that you had downloaded for earlier versions of MicroTx.

    The latest image of the transaction coordinator is available at installation_directory/otmm-24.2/otmm/image/tmm-24.2.tgz. In the next few steps, you will use this file to update the existing transaction coordinator image.

  2. Load the transaction coordinator image to the local repository, tag the image, and then push the image. See Push Image to a Docker Registry.
  3. Set INIT_CONTAINER_ENABLED to True in the tcs.yaml file to enable the creation of an init process. The tcs.yaml file is located in the installation_directory/otmm-24.2/otmm/image folder.
  4. Run the following command to initiate an init process in a Docker container to upgrade MicroTx.

    Syntax

    docker container run --name init-otmm-app \
    -v "$(pwd)":/app/config \
    -w /app \
    -p 9000:9000/tcp \
    --env CONFIG_FILE=/app/config/tcs.yaml \
    --network=host \
    -e STORAGE_DB_CREDENTIAL='{"password":"<dbUserpassword>", "username":"<DBuserName>"}' \
    -d tmm:24.2

    Where,

    • --name init-otmm-app is the name of the MicroTx application that you want to upgrade.
    • -v "$(pwd)":/app/config mounts the current directory into container at the /app/config path.
    • -w /app specifies the working directory as /app. In this sample command, /app remains the default working directory as the volume is also mounted on this directory based on the value provided for the -v flag.
    • --env CONFIG_FILE=config/tcs.yaml specifies the location of the tcs.yaml file, which contains the coordinator configuration details.
    • -e STORAGE_DB_CREDENTIAL provides the user name and password to access Oracle Database.
    • tmm:<version> is the MicroTx Docker image that you have loaded to the local Docker repository.
  5. Remove the independent container, in which the init process ran, from the list of docker containers in Docker environment. The init process terminates automatically after it finishes the upgrade. Run the following command to remove the independent container.
    docker container rm <container_ID_of_init_otmm_app>
  6. Update the tmm-stack-compose.yaml file to provide the name of the latest MicroTx coordinator image.
  7. Perform one of the following tasks to complete the upgrade process depending on your Docker Swarm environment.
    • If a Docker stack is not deployed or if you want to create a new stack, run the following command to deploy a new Docker stack.

      Command Syntax

      docker stack deploy -c tmm-stack-compose.yaml <name_of_stack>
    • If a Docker stack is already deployed and running, run the following command to update the stack.

      Command Syntax

      docker service update --image {latest image of MicroTx coordinator} {name of the MicroTx
          service}

      Sample Command

      docker service update --image 198.51.100.1:5000/tmm:1679 tmmdemo_otmm-tcs