From 7a3af8d6a9c5ec9202d5cd22dd5b97fed5b88f99 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 12 Sep 2023 22:59:33 +0200 Subject: [PATCH] Update upgrade try fix keep the association.sqlite DB --- scripts/upgrade | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index b831b54..5fec1a8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,12 @@ if [[ -z "${secret_key:-}" ]]; then ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key fi +#================================================= +# BACKUP SQLITE DATABASE +#================================================= +ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5 +cp -a $install_dir/data/association.sqlite /tmp/ + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -79,6 +85,9 @@ fi ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php" ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php" +# Restore the sqlite DB +mv /tmp/association.sqlite $install_dir/data + # Permissions on files and directories chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir"