From 96ddeb53d52b4dd9dc6214985544c36e18da5d8d Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Sat, 16 Sep 2023 08:59:19 +0200 Subject: [PATCH] better method for upgrade --- scripts/upgrade | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5fec1a8..c433912 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,7 +33,8 @@ 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/ + +cp -R $install_dir/data /tmp/data #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -44,7 +45,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="association.sqlite data skel-dist config.local.user.php" --full_replace=1 + ynh_setup_source --dest_dir="$install_dir" --keep="data config.local.user.php" --full_replace=1 fi chmod -R o-rwx "$install_dir" @@ -86,7 +87,7 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config. 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 +rsync -a /tmp/data/ $install_dir/data/ # Permissions on files and directories chmod -R o-rwx "$install_dir" @@ -113,6 +114,6 @@ sleep 5 # END OF SCRIPT #================================================= # remove directory duplicated -ynh_secure_remove --file="$install_dir/data/data" +ynh_secure_remove --file="tmp/data" ynh_script_progression --message="Upgrade of $app completed" --last