Upgrade transfers data and does not lose them

This commit is contained in:
Tomáš Peterka 2020-11-02 15:38:09 +01:00 committed by GitHub
parent 8ccd6f3533
commit cfaf4d5697
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,8 +71,8 @@ if [ $final_path == "/var/www/$app" ]; then
ynh_app_setting_set --app $app --key final_path --value $final_path
test -e /var/log/seafile && rm /var/log/$app
if ! [ -z "$(ls -A $final_path/seafile_data)" ]; then
# Data directory empty, so considere that all data are already in /home/yunohost.app/seafile
mv /opt/yunohost/$app/seafile-data/* /home/yunohost.app/seafile-data/
# Data directory NOT empty, transfer data to /home/yunohost.app/seafile
mv $final_path/seafile_data/* /home/yunohost.app/seafile-data/
ynh_secure_remove $final_path/seafile_data
ln -s /home/yunohost.app/seafile-data $final_path/
fi