Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@auckenox
Last active June 15, 2020 16:12
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save auckenox/bff49b7af16e064e8d9d3706b9ed0d89 to your computer and use it in GitHub Desktop.
Save auckenox/bff49b7af16e064e8d9d3706b9ed0d89 to your computer and use it in GitHub Desktop.
[PLEASE DO NOT USE THIS SCRIPT ANYMORE] Synology move packages to another volume
#!/bin/bash
# ######################################################################################################
## WARNING: THIS SCRIPT HAS THE POTENTIAL TO HARM YOUR DSM ON CURRENT VERSIONS OF DSM! DO NOT USE IT
# ######################################################################################################
# this script moves ALL packages from volume-x to volume-y
# For Synology DSM - tested with DSM6.1
# change these values
from_vol="volume1"
to_vol="volume2"
## dont change anything below here ##
from_path="/$from_vol/\@appstore/"
to_path="/$to_vol/\@appstore/"
move_package () {
echo "##############################################################"
echo "moving package $1 from $2 to $3"
echo ":::: stopping package $1 ..."
/var/packages/$1/scripts/start-stop-status stop
echo ":::: removing link to package from $2 ..."
rm -fv /var/packages/$1/target
echo ":::: adding link to package to $3 ..."
ln -s /$3/\@appstore/$1 /var/packages/$1/target
echo ":::: starting package $1 on new location ..."
/var/packages/$1/scripts/start-stop-status start
}
# scanning the @appstore folder for packages
for d in $from_path*/ ; do
package_name="$(basename $d)"
move_package $package_name $from_vol $to_vol
done
echo "##############################################################"
@jersam
Copy link

jersam commented Aug 19, 2018

gave it a go on lastest DSM, packages all error'd.

doing a repair now

@bulldogarkansas
Copy link

@jersam did you get it fixed? May need this.

@jersam
Copy link

jersam commented Jun 15, 2020

@bulldogarkansas unfortunately I dont remember =/

@auckenox
Copy link
Author

auckenox commented Jun 15, 2020

i strongly advise against using this old script, it worked once on one of my synologys some years ago.
synology moves more and more of their own stuff to packages (which is a good thing),
but this script now tries to move some synology internal packages / services and eventually fails and can potentially harm your DSM install. (it does not harm your data or hardware, but in the DSM OS it can break stuff, for example: the webui don't work anymore etc..)
it would be nice if synology would add this functionality to their webgui, but 3y later still no luck.

@bulldogarkansas
Copy link

@auckenox thanks for the post. Yes I agree. This will be my project very soon. I have to figure something out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment