Improve MariaDB upgrade

This commit is contained in:
VirtuBox
2020-10-23 16:33:35 +02:00
parent 1b0d9d7d8d
commit 51b078e86d
2 changed files with 18 additions and 5 deletions

View File

@@ -42,23 +42,26 @@ class WOStackMigrateController(CementBaseController):
wo_mysql_old_repo):
WORepo.remove(self, repo_url=wo_mysql_old_repo)
# Add MariaDB repo
Log.info(self, "Adding repository for MariaDB, please wait...")
pre_pref(self, WOVar.wo_mysql)
# Install MariaDB
Log.info(self, "Updating apt-cache, hang on...")
Log.wait(self, "Updating apt-cache ")
WOAptGet.update(self)
Log.info(self, "Installing MariaDB, hang on...")
Log.valide(self, "Updating apt-cache ")
Log.wait(self, "Upgrading MariaDB ")
WOAptGet.remove(self, ["mariadb-server"])
WOAptGet.auto_remove(self)
WOAptGet.install(self, WOVar.wo_mysql)
post_pref(self, WOVar.wo_mysql, [])
WOShellExec.cmd_exec(self, 'systemctl daemon-reload')
Log.valide(self, "Upgrading MariaDB ")
WOFileUtils.mvfile(
self, '/etc/mysql/my.cnf', '/etc/mysql/my.cnf.old')
WOFileUtils.create_symlink(
self, ['/etc/mysql/mariadb.cnf', '/etc/mysql/my.cnf'])
WOShellExec.cmd_exec(self, 'systemctl daemon-reload')
post_pref(self, WOVar.wo_mysql, [])
@expose(hide=True)
def default(self):