HA must not be actived when migrate sqlite to mysql

This commit is contained in:
Emmanuel Garette 2019-02-19 11:53:12 +01:00
parent 6a75234cb8
commit e6729673fb
2 changed files with 8 additions and 1 deletions

View File

@ -44,7 +44,7 @@ function updateDB()
function to_mysql() { function to_mysql() {
if [ "$script" = 'instance' ] && [ $(CreoleGet one_database_type) = "mysql" ] && [ $(CreoleGet one_ha_role leader) = "leader" ]; then if [ "$script" = 'instance' ] && [ $(CreoleGet one_database_type) = "mysql" ] && [ $(CreoleGet one_ha_role leader) = "leader" ]; then
Question_ouinon "Voulez-vous migrer de SQLite à Mysql ?" "True" "non" "warn" Question_ouinon "Voulez-vous migrer de SQLite à Mysql ?" "True" "oui" "warn"
rep=$(echo "$?") rep=$(echo "$?")
if [ "$rep" == "0" ]; then if [ "$rep" == "0" ]; then
# do not recover db on follower # do not recover db on follower
@ -52,7 +52,12 @@ function to_mysql() {
DB=$(CreoleGet one_database_name) DB=$(CreoleGet one_database_name)
USER=$(CreoleGet one_database_user) USER=$(CreoleGet one_database_user)
PASS=$(CreoleGet one_database_pass) PASS=$(CreoleGet one_database_pass)
cp -a /etc/one/oned.conf /etc/one/oned.conf.ori
# HA ne doit pas être activer pour la migration
CreoleCat -s /usr/share/eole/creole/distrib/oned-ha-mysql.conf -o /etc/one/oned.conf
oned -i
onedb sqlite2mysql -s /var/lib/one/one.db -u $USER -p $PASS -d $DB -S $HOST onedb sqlite2mysql -s /var/lib/one/one.db -u $USER -p $PASS -d $DB -S $HOST
cp -a /etc/one/oned.conf.ori /etc/one/oned.conf
fi fi
fi fi
} }

2
tmpl/oned-ha-mysql.conf Normal file
View File

@ -0,0 +1,2 @@
%set global %%enable_one_ha='non'
%include '/var/lib/creole/oned.conf'