linotp.cli.mysql_cmd module¶
MySQL-specific database backup implementation.
The difference between this and the dbsnapshot command is that dbsnapshot uses the SQLAlchemy object-dump facility while this implementation uses the MySQL-specific mysqldump shell command.
This means that backup can be used to make backups that can be restored on MySQL-based LinOTP instances of different versions, while dbsnapshot can be used to make backups that are independent of the actual database engine but can run into issues as the definitions of LinOTP objects evolve.
In other words, backup is probably more useful in daily life (as long as MySQL is your thing) but dbsnapshot lets you migrate your LinOTP instance from MySQL to PostgreSQL (for example).
- linotp.cli.mysql_cmd.backup_mysql_database()¶
backup the mysql database via mysqldump
similar to the original bash script, thus - using the same time-stamp format - backup of the enckey
- linotp.cli.mysql_cmd.restore_mysql_database(filename: str)¶
restore the mysql dump of a former linotp tools backup
@param file: backup file name - absolute filename