mirror of
https://github.com/YunoHost-Apps/minio_ynh.git
synced 2024-09-03 19:46:18 +02:00
First try for migration
This commit is contained in:
parent
c6a0d68a57
commit
1fcd9ec64d
1 changed files with 21 additions and 12 deletions
|
@ -49,18 +49,6 @@ ynh_clean_setup () {
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||
|
||||
if [ "$(yunohost app info minio | grep -oEi [0-9]{4})" == "2022" ]
|
||||
then
|
||||
ynh_script_progression --message="Migration from Filesystem to Single-Node Single-Drive mode"
|
||||
else
|
||||
ynh_script_progression --message="No migration required"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
@ -163,6 +151,27 @@ pushd $mc_path
|
|||
ynh_exec_warn_less sudo -u $app ./mc --no-color alias set minio "https://$domain" "$admin" "$password" --api S3v4
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||
|
||||
if [ "$(yunohost app info minio | grep -oEi [0-9]{4})" == "2022" ]
|
||||
then
|
||||
ynh_script_progression --message="Migration from Filesystem to Single-Node Single-Drive mode"
|
||||
for d in * ; do
|
||||
ynh_script_progression --message="Migrating bucket $d"
|
||||
mv "$d" "DATA_$d"
|
||||
mkdir "$d"
|
||||
chmod 750 "$d"
|
||||
chmod -R o-rwx "$d"
|
||||
chown -R $app:www-data "$d"
|
||||
ynh_exec_warn_less sudo -u $app ./mc mirror --preserve --watch "DATA_$d" minio/"$d"
|
||||
done
|
||||
else
|
||||
ynh_script_progression --message="No migration required"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue