Testimonials
What our customers say about Team Password Manager

How to upgrade a Team Password Manager installation in a Docker container

Current Team Password Manager version: 12.162.284

In this document we're going to see how to upgrade a Team Password Manager installation in a Docker container to the latest version of Team Password Manager.

In this tutorial we're going to use:

  • A Docker container running Team Password Manager, named teampasswordmanager. This name is the one used in the --name parameter of docker run or the "services" name in a docker-compose.yml file. This container is running a Team Password Manager installation that is not the latest, so it needs to be upgraded.
  • The URL to access Team Password Manager is https://tpm.mycompany.com.

We're going to reference the installations we did in the previous Docker documents:

See also the following document to learn how the Team Password Manager Docker image works when upgrading: How does a Team Password Manager Docker image work (see Situation 2).

Let's upgrade Team Password Manager:

1. Backup

You should backup the database and files before attempting an upgrade. Here we explain how to do it:

How to backup a Team Password Manager installation in a Docker container

2. Delete the current container

We're going to delete the current container and create a new one with the latest version of Team Password Manager.

Since the Team Password Manager Docker image creates a volume with the Team Password Manager files and others (log, ssl certificates), these data will be preserved.

To delete the current container:

  • If you created it with docker run, stop it and delete it:
    docker stop teampasswordmanager
    docker rm teampasswordmanager
  • If you created it with Docker Compose, execute this from the same folder where you have the docker-compose.yml file:
    docker-compose down

As stated before, the volume that the Docker container creates is not deleted when you delete the container.

If you created the installation with Docker Compose, the MySQL container also creates a volume that contains the database and additional data, that is not deleted either.

To see the volumes in your system, use the following command:

docker volume ls

3. Create a new container with the latest version of Team Password Manager

We'll now create a new container with the following features:

  • It must use the same volume as the old container.
  • It must use the latest Team Password Manager Docker image: teampasswordmanager/teampasswordmanager:latest.
  • The TPM_UPGRADE must be set to 1: TPM_UPGRADE=1

The best way to do this is to use the same commands that you used to create the old container but making sure that you're using the latest image and TPM_UPGRADE=1. So:

First make sure you have the latest image downloaded:

docker pull teampasswordmanager/teampasswordmanager:latest

Then:

  • If you used docker run to create the old container (see "How create a Team Password Manager Docker container"), do this:
    • Edit the env_vars file and change TPM_UPGRADE=0 to TPM_UPGRADE=1.
    • Execute this to create the container:
      docker run -d -p 80:80 -p 443:443 --name teampasswordmanager --env-file=env_vars -v tpm_volume:/var/www/html teampasswordmanager/teampasswordmanager:latest
  • If you used Docker Compose to create the old container (see "How to create a full Team Password Manager installation with Docker Compose"), do this:
    • Edit the docker-compose.yml file and change TPM_UPGRADE=0 to TPM_UPGRADE=1. Also make sure that the teampasswordmanager image is teampasswordmanager/teampasswordmanager:latest.
    • Execute this to create the containers:
      docker-compose up -d

4. Execute the Team Password Manager upgrader

  • If the version of Team Password Manager is 12.160.277 or greater, do this:

    Execute the Team Password Manager upgrader by going to this URL:

    https://tpm.mycompany.com/index.php/upgrade

    The Team Password Manager installation should now be upgraded and you can access it at https://tpm.mycompany.com/.


  • If the version of Team Password Manager is lower than 12.160.277, you'll need to enable Maintenance mode to upgrade. Do this:

    To enable Maintenance Mode, login into the container:

    docker exec -it teampasswordmanager bash

    (If you used Docker Compose, the name of the container will not be teampasswordmanager, check it with docker-compose ps)

    And then edit /var/www/html/site/config.php and add this line:

    define('MAINTENANCE_MODE', TRUE);

    Next, execute the Team Password Manager upgrader by going to this URL:

    https://tpm.mycompany.com/index.php/upgrade

    Finally, delete the define('MAINTENANCE_MODE', TRUE); line in /var/www/html/site/config.php and enter exit to exit the container.

    The Team Password Manager installation should now be upgraded and you can access it at https://tpm.mycompany.com/.

5. Set TPM_UPGRADE back to 0

Once your installation of Team Password Manager is upgraded, set TPM_UPGRADE back to 0 so that is isn't upgraded unintentionally.


Document changelog

Mar 21, 2024: Set TPM_UPGRADE back to 0 after upgrading
Feb 15, 2024: Maintenance mode is not required for upgrades since v. 12.160.277
Nov 18, 2020: Document created
Questions or Problems? Please contact our support department