Zero-TOTP database backup and restore
Backing up your database is important to prevent data loss. You can use the mariadb-dump
utility to backup your database.
Backup your database
Info
If you are not using environment variables in docker, make sure to update "$MYSQL_DATABASE"
and "$MYSQL_ROOT_PASSWORD"
.
Backup location :
- The backup file will be named db_backup_*.log
- The backup file will be saved in the
/var/lib/mysql
directory of the database container which is a mounted volume in your host. Check the mount point in yourdocker-compose.yml
file or thedocker run
command to find the backup file.
It is highly recommended to copy the backups files into an external filesystem and verify they are not empty !
Restore a database backup
Make sure to mount the backup file into the database container before running the restore command. You can use the /var/lib/mysql
mounted volume to copy the backup file into the container. The default path for the mounted volume is $pwd/database/config/
.
Info
If you are not using environment variables in docker, make sure to update "$MYSQL_DATABASE"
and "$MYSQL_ROOT_PASSWORD"
.