diff --git a/scripts/upgrade b/scripts/upgrade index 748671c..0699122 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -170,6 +170,19 @@ ynh_add_systemd_config pushd $final_path # Migrate from SQLite to PostgreSQL if [ $need_migration_from_sqlite_to_psql -eq 1 ]; then + # Preinstall with sqlite + carton install --deployment --without=mysql --without=htpasswd --without=test + + # if /var/log/$app/production.log is a symbolic link, then move it to $final_path/log/production.log + if [ ! -L "/var/log/$app/production.log" ] + then + mv "/var/log/$app/production.log" "$final_path/log/production.log" + chown -R $app: "$final_path/log/production.log" + fi + + # Restart with news parameters + ynh_systemd_action -n $app -a restart -l "Creating process id file" -p "$final_path/log/production.log" + carton exec script/lufi sqliteToOtherDB fi