007revad / Synology_app_mover

Easily move Synology packages from 1 volume to another volume
MIT License
317 stars 25 forks source link

[Question] can script work with source volume curently crashed read-only ? #122

Open OrpheeGT opened 1 week ago

OrpheeGT commented 1 week ago

Hello,

I have a BTRFS volume1 in crashed state, as read only. Data and apps are still there and readable.

I would like to know if the script will/can still work if volume1 is read only...

I want to create a new volume2 on new disks... and the migrate everything on new volume.

(all data are already backed up on a safe place)

Thanks

007revad commented 6 days ago

The script currently can't move packages from a read only volume as the script moves files (though it does copy the files instead of moving them if the folder already exists on the target volume).

I could whip up a script to create all the necessary folders on volume, so when you run the script with move selected the script will copy all the files and folders.

Or instead of moving the apps:

  1. The script can backup all the apps to a shared folder on volume 2.
  2. Then you'd need to uninstall the apps that are on volume 1 (see notes below).
  3. Then install the apps on volume 2.
  4. Finally run the script and select restore to restore them on volume2.

Notes:

OrpheeGT commented 6 days ago

Hi

I replaced " mv " with " cp -r " inside the script and it seemed to work for most of apps. "rsync -rav source target" would probably have been better than " cp -r "

Only Container Manager failed as it tries to start the app. All apps were in "needs repair" state after it.

I did the pgsql suggestion from other issue too.

repair worked on most of the apps, but did not try them yet.

I'm still working on my shared folders as I can't "edit" them as it does not allow to edit a read-only shared folder...

Edit : I can confirm "cp -r" is a bad idea, rsync is better for preserving gid/uid/rwx

007revad commented 6 days ago

I would have used cp -pr or rsync.

Only Container Manager failed as it tries to start the app.

The script v4 starts Container Manager if it's stopped so it can prune dangling images and export each container's settings to a json file.

In v4.0.68-RC comment out lines 2426 to 2448, or try v3.1.60 with 'mv -f' replaced with with cp -prf to copy Container Manager.