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
docker runor the "services" name in a
docker-compose.ymlfile. 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
We're going to reference the installations we did in the previous Docker documents:
- How create a Team Password Manager Docker container
- How to create a full Team Password Manager installation with Docker Compose
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:
You should backup the database and files before attempting an upgrade. Here we explain how to do it:
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:
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:
TPM_UPGRADEmust be set to 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
First make sure you have the latest image downloaded:
docker pull teampasswordmanager/teampasswordmanager:latest
- If you used
docker runto create the old container (see "How create a Team Password Manager Docker container"), do this:
- Edit the
env_varsfile and change
- 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
- Edit the
- 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.ymlfile and change
TPM_UPGRADE=1. Also make sure that the teampasswordmanager image is
- Execute this to create the containers:
docker-compose up -d
- Edit the
4. Execute the Team Password Manager upgrader
We'll now enable Maintenance Mode, execute the upgrader and disable Maintenance Mode.
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
And then edit
/var/www/html/site/config.php and add this line:
Next, execute the Team Password Manager upgrader by going to this URL:
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
|Nov 18, 2020:||Document created|