diff --git a/posttemplate/90-one-db b/posttemplate/90-one-db index 5fd0331..7f0f2d7 100644 --- a/posttemplate/90-one-db +++ b/posttemplate/90-one-db @@ -44,7 +44,7 @@ function updateDB() function to_mysql() { 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 "$?") if [ "$rep" == "0" ]; then # do not recover db on follower @@ -52,7 +52,12 @@ function to_mysql() { DB=$(CreoleGet one_database_name) USER=$(CreoleGet one_database_user) 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 + cp -a /etc/one/oned.conf.ori /etc/one/oned.conf fi fi } diff --git a/tmpl/oned-ha-mysql.conf b/tmpl/oned-ha-mysql.conf new file mode 100644 index 0000000..9094c89 --- /dev/null +++ b/tmpl/oned-ha-mysql.conf @@ -0,0 +1,2 @@ +%set global %%enable_one_ha='non' +%include '/var/lib/creole/oned.conf'