In this document we're going to explain how to backup the data (database and files) of a Team Password Manager installation in Docker containers.
For reference, here's our general backup document: How to make a backup of Team Password Manager
Backing up the database
If your database runs in a Docker container, which is the case if you're using Docker Compose, execute this command from the host to make a backup copy of your Team Password Manager database:
docker exec -it mysql_container mysqldump -utpm_user -ptpm_password tpm_database > backup_file.sql
mysql_containeris the container that runs the database. You can see the running containers in your system with this command:
tpm_databaseis the Team Password Manager database.
tpm_passwordare the credentials of the user that has access to the
Basically this command executes
mysqldump inside the container and returns the
backup_file.sql to the host.
Backing up the files
Execute this command from the host to copy the software files (including the uploads folder) into the host:
docker cp teampasswordmanager_container:/var/www/html/site/. ./backup/
teampasswordmanager_container is the container that runs Team Password Manager. You can see the running containers in your system with this command:
This command copies the
/var/www/html/site/ folder and its subfolders and files to the host, in the
backup folder in the current folder. This copies all the software files, if you want to copy only the
uploads folder, use this instead:
docker cp teampasswordmanager_container:/var/www/html/site/uploads/. ./backup/
|Nov 18, 2020: